Fixed bugs in custom validators.