Improved validation handling.