java. Cleaned up code-generation, fixed #155.