Improvements to code generation + YAP compatibility.