Fix a bug with validation