Tidying up the grammar generation process.
Changing the check for the grmmar generator.