Added better management of validation and validation messages.