Fixed array index problem.