Merge pull request #46 from ben-ng/master

Fixes the fix from #43 that fixes #42
Merge pull request #48 from ben-ng/master

Add unit test for #47
Version 0.0.40