Define classes for validation errors correctly