Added unit test for #5534.