Bugfix: rare race condition in stop sequence