Fix off by one index error in tests.