Rework "endScenario" to hopefully avoid crash