Bug 19563: (follow-up) Restore checking sort variable