Merge pull request #1 from cyrille-leclerc/master

cleanup, enhancements and unit tests
Enhance exception message.