Roger Federer bounced back from a shaky start to keep a perfect record.

The five-time champion improved to 19-0 in the first round of the U.S. Open by beating Sumit Nagal 4-6, 6-1, 6-2, 6-4 in the last match to finish the day's action.

There were plenty of jokes in Flushing Meadows about Federer facing an opponent whose name sounded so close to longtime rival Rafael Nadal's, but Federer wasn't laughing when the 190th-ranked qualifier from India took the first set.

But Federer soon took control to avoid losing in the first round of a Grand Slam for the first time since the 2003 French Open.

Earlier in the day, top-seeded Novak Djokovic felt good enough after his workmanlike first-round victory at the U.S. Open to do a little dancing.

Djokovic, who is now 34-1 in his last 35 Grand Slam matches, dispatched Spaniard Roberto Carballes Baena 6-4, 6-1, 6-4.

He then gave an on-court interview in which he acknowledged dancing in Central Park as part of his pre-match preparation. Djokovic promptly went to his bag and pulled out two rackets that he used as faux maracas while he showed off his Latin dance moves to the Arthur Ashe Stadium crowd.

Djokovic, winner of this year's Australian Open and Wimbledon crowns, is seeking his fourth U.S. Open and 17th Grand Slam tournament title.