Fix unexpected restarts