Fix array indices