Fix how sorting is handled by default.

Sorting now uses the "external field names" (eg labels) instead of the actual
internal field names, in cases where they differ.