Fixed bugs in field and validator