Improved error handling.
Getting ready for version 1.0.1.
Merge branch 'release/1.0.1'