Improved login error handling