Improvements to login/out.