Added test for issue #5187