Set up compiled function caching, fix stack pointers