Please consider merging this patch to close issue #2

The enclosed patch fixes #2. Test case included.