Added tests for issue #20501.
Added tests for issue #20501.