Add test case for issue #511
Merge pull request #868 from slick/tmp/issue-511

Add test case for issue #511