Simplify error handling
Merge pull request #67 from untitaker/test

Simplify error handling