Fixed out of bounds array access.