Check return code from validator rather than grep

Thanks @rpiazza for noticing that the validator output had changed