Bug fixes on validator. Made slightly stricter.