Fixed an indexing bug.