Nadal overcomes third set wobble to reach second round