More resilient shutdown in runtime