Fixes #5079: added test case.