Fix an index error