Better error handling
Merge pull request #2 from efontana/rel1.x

Better error handling