Fix a small bug with format validation