Fixed codegen for copyprivate