Improved login form validation.