Fixed index ordering bug.