History-making Kei Nishikori was dumped out of the Shanghai Masters on Wednesday by American Sam Querrey as defending champion Andy Murray was handed a walkover into the third round. The tall American recovered from losing the first set to seal a 2-6, 6-1, 6-4 win over Nishikori, who made history on Sunday by becoming the first Japanese player to win the Japan Open. Also in second-round action, second seed Novak Djokovic cruised through his tournament opener and there were wins for fourth seed Tomas Berdych and 13th seed Stanislas Wawrinka of Switzerland. Nishikori said he had needed treatment during the match on his right ankle, which had been bothering him since last week. \"I tried to play but he had a good serve,\" he said. \"I broke him first in the third set but couldn\'t finish the match. It\'s disappointing but I was close to win with this injury. Nothing I can do,\" he said. The 22-year-old Japanese romped into a 4-0 lead and sealed the opener despite a medical timeout late in the set. But a missed overhead early in the second set contributed to an early break for Querrey and the Japanese 14th seed lost his rhythm, showing his frustration as his rejuvenated opponent, ranked 22nd, levelled the match. In the third set two breaks of serve proved costly for Nishikori, who is at a career high of number 15 in the rankings after his weekend win over Canada\'s Milos Raonic, his first on the Tour since 2008. Djokovic, who has a shot at regaining the world number one ranking if he wins the title and Federer loses before the quarter-finals, dismissed Bulgaria\'s Grigor Dimitrov 6-3, 6-2. But US Open champion Andy Murray did not even have to take to the court as Germany\'s Florian Mayer withdrew with a rib injury. \"I\'ll practise again. I mean, you never know whether it\'s a good or a bad thing. I mean, you\'re obviously prepared to play the match,\" said Murray. \"Yeah, sometimes it happens when you get a walkover. You just need to make sure you do enough practice and stay sharp.\" Top seed Roger Federer, playing his first tournament on the Tour since a quarter-final defeat to Berdych at the US Open, was due to take on Taiwanese qualifier Lu Yen-hsun in an evening clash. The Swiss world number one\'s build-up was clouded by a death threat from a blogger in China but the Internet user, in a fresh posting on the popular baidu.com site, said he had apologised. He remained at large. A Shanghai police spokesman on Wednesday declined to comment on the case. As the season draws towards to a close there are four places still up for grabs at next month\'s season-ending World Tour Finals in London. The top three have all qualified, along with the injured Rafael Nadal.