Fix an indexing error