More codegen enhancements