regression test for #339