Fixed gui runnging to properly close lua state.