Adding some fixes to Login functionality.