Added tests for issue #20501.