Improvements and bug fixes to the core validation class.