Fix returning process exit codes

This should fix issue #133