Federer shrugs off injury to reach quarter-finals