Fix a bug in getPCNextRank