Add test for issue 340