Fixed user authentication bugs.