Fix user authentication and errors issues