Changes to remove spurious </sort> from Order By vars