Better error handling
Fix tests
Merge pull request #75 from marmelab/better_error_handling

[RFR] Better error handling