Add test case for issue #511

Review by @cvogt