test for issue #561
Refactor regression test for #561