Add test for issue #513