Fix shutdown regression introduced in 9022506f.