Add test for issue #4335