fix generated code for packages