Fix stupid bug in createIndexTable method