Add regression test re #581