Fixed a small bug in validation