Fixes to the login process