fixed code generation issues