Fix for issue #12, and test for it
Merge pull request #15 from Hi-Fi/master

Fix for issue #12