Correct a bug of incorrect array iteration in rrpaa and prcs