Added test case for issue #1791