fixes for 3.4.5 compatibility.
elaborate example including recording, requires JITLibExtensions.