Minor changes / fixes to login handling.
