Added stack reset to lua event callbacks to temporarily fix stack overflows, fixed project export on Mac