Add test for issue #5
Fix #5