Fix ranks for equality