Merge pull request #10 from flambert/fixes

Fix various problems found while using the library