Added unit test for the bug reported in issue #161