[FOLD] Hack to fix simulator state
[WIP/FOLD] FunctionQueue to fix simulation