Added error checking to user_login().