Use correct exception object (fixes #149)
Merge pull request #152 from FelixOnline/more-error-fixes

Use correct exception object (fixes #149)