Regression test for issue #1118.