Fixes sort regressions introduced when multiple collections were implemented.