Revert changes to sortorder logic