Issue #21455: Fix for sorting