Fixes #3175 - process exiting is handled more carefully
Merge pull request #19 from ares/master

Fixes #3175 - process exiting is handled more carefully