Don't order on things that aren't supposed to be a sort order. Fixes #1022.