code: fix bugs in runtime thunk code, and tweak inliner settings