Revert "removed process.exit() statements, since they might be causing problems"

This reverts commit 9d8331571e46d944b302ea8b31200f00ff7eaa3d.