Fixed bugs in validator class