Add regression test for #2784