New `shutdown` method
Merge pull request #31 from simao/shutdown

First try to deal with #27