Validation functions fixes