Fixed an obscure issue where logins woudl sometimes crash