Fix for issue #3, create test case for it