adding index fixup to the lua generator