Issue #151 Lots of bug fixes. Rtc compiled function now runs, but somehow the VM still gets stuck afterwards.