[Rank.py] Fix errors