Fixed bug #931: Crash with exception in shut-down stage