Fix ranking bug