Fix index creation