fixes for codegen