Fix array indexing, treat as sequential everywhere. There was a bug when the arrays are sometimes treated as associative and other times as sequential.