Moved validation test into parser