Fix rank index.