Fixing Java code generation