return non-zero value when unsuccessfully exiting
Merge pull request #13 from alxndr/nonzero-retval-on-error

return non-zero value when unsuccessfully exiting