Fixed forgotten exit codes
fixes #2959 - Error handling
Merge pull request #30 from mbacovsky/2959_error_handling

2959 error handling