Fix crash on shutdown (only in verbose mode).