Fix bug in the validator