fixed c++ codegen merge bugs