fixed codegen merge bugs