Tweaked trampoline code for performance.