Bug fixes on user registration functions.