Add test for bug #334