Minor bugfix to shutdown locking