Fix ranks order