World No. 3 and defending champion Roger Federer suffered a surprise defeat in the second round of the Shangahi Masters Tuesday, losing 7-6(4), 2-6, 6-3 to Spain's Albert Ramos-Vinolas. The Swiss, returning to action after a month off, looked rusty against the 70th-ranked qualifier and despite looking back on track when he cruised through the second set, he succumbed in the decider to a single break of serve. US Open runner-up Federer, 34, banged down 15 aces and won more points than his opponent but a lack of sharpness at crucial moments sent him spinning to defeat. In other second round action, ninth seed Milos Raonic, one of several players hovering around the cut-off mark for the year-ending ATP World Tour Finals in London, came through against Brazil's Thomaz Bellucci in two tiebreaks. South Africa's Kevin Anderson, seeded 12, beat German veteran Tommy Haas in straight sets. Top seed Novak Djokovic, fresh from winning a sixth Beijing title, begins on Wednesday against Slovakia's Martin Klizan. Andy Murray, seeded three despite moving above Federer in the rankings, plays American Steve Johnson on Wednesday. Australia's Nick Kyrgios was, meanwhile, slapped with a $1,500 fine Tuesday for a foul-mouthed outburst at the Shanghai Masters, officials said, pushing him closer to a potential four-week ban. Kyrgios was fined for an audible obscenity during his win over Andreas Haider-Maurer, when he was also heard calling the tournament a "circus" and complaining about the ball kids, according to reports. Kyrgios received his second code violation in a week when he slammed the "f——— surface" at the Shanghai venue Monday. Venus struggles Seven-time Grand Slam winner Venus Williams battled through a grueling first-round match at the Hong Kong Open Tuesday, taking three sets to beat unseeded Yuliya Beygelzimer. The American finally sealed victory 2-6, 6-4, 6-4 after more than two hours on court. Williams, 35, is fighting for a place in the eight-player WTA Finals in Singapore later this month with Hong Kong her last chance to get the points she needs. She is currently 11th in the Road to Singapore rankings. Williams has had a resurgent season, winning her biggest title in five years in Wuhan at the beginning of October. But Ukrainian Beygelzimer, who came into the competition as a last-minute Lucky Loser from the qualifying rounds, outpaced her in the first set with blistering returns. Williams hobbled around the court with a strapped left thigh but managed to claw her way back to one set all. Both players dropped their serve in the third but Williams finally turned on the power to take the set with a scorching pass. Former world No. 1 Jelena Jankovic also struggled to find her rhythm against Romanian qualifier Ana Bogdan but went on to seal a 6-4 6-2 win. Australia's Samantha Stosur and Caroline Garcia of France went through to the second round, as did Britain's Heather Watson. In other results: Alize Cornet (France) beat Kateryna Kozlova (Ukraine) 6-4, 6-0; Wang Yafan (China) beat Christina McHale (US) 6-3, 4-1 (McHale retired).