shouldn't you be creating this metatable as an upvalue? Now it generates a new metatable for each table you apply the case-insensitive stuff to. When you de fine the metattable as an upvalue, you can reuse the same metatable for multiple case-insensitive tables.

or am I missing something?