Fixes to login system.