More fixes for delayed shutdown