Add test for issue 4503, closes #4503