Closing of file handles in packed grammars.

..and some minor tool stuff.