Fix an error on shutdown.
Merge pull request #48 from me4502/master

Fix an error on shutdown.