Fixed bug #931: Crash with exception in shut-down stage
Merged pull request #69