fix broken error handling
Merge pull request #168 from coryb/testing

fix broken error handling