Fixed null pointer exception during validation.