Code gen tweaks