Fixed various bugs in Grammars.