Fixed redirecting to a funny place after login.