Fix for a crash during shutdown
Merge pull request #126 from abelcher/master

Fix for a crash during shutdown