Fixed bug in validation.