More fixes to login and registration