Bug fixes on login and added registration