Added regression test for #2767.