Fix tests so they don't rely on being sorted.