fix codegen when number of types > 256