Fix _index generation