Fixed minor bugs for login and registration