Refs #9993. Replacing wrong code in unit test

Out-of-bounds vector access made the test fail in VC.