Fixed login error handling