Fix errors in validate