fix rank calc
Merge branch 'hotfix-2536'