fix crash compiling thunks