Fix 64-bit break and minor codegen tweak