Fixed an indexing error