Fix loop limit that caused out of bounds error on vector access.

Refs #7672
Merge branch 'feature/7672_moment_calc' into develop