Fix where table.insert puts value when inserting last