Fix index from template