Fixed initial bugs in validation