Don't crash on shutdown