Added unit test for pull request #2018