Add regression test for issue #334 (already passes)