New tests. Several bugfixes in tests, parsers and generators.