Nats avoid the sweep with win over Miami