Fixed indexing bug.