clean up error handling
Merge pull request #2 from michielbdejong/gh-pages

for Nick