Added proper checks for username.