Fixed crash if game loses focus after pause