Federer sneaks through in Halle