Add new tests and minor fixes to grammars.