Tweaks to grammar valid checks