Added a test case for #5, confirming the bug.
Patch to fix issue #5.