Attempt to fix bug in validation code