Fix a bug in codegen when using data types