Minor fixes in login process