Fix bug in error message on validation