bug-fix to grammar generation