Fix sort on join columns