Merge "Fix an "array index out of bound" bug for RPA." into lmp-dev