lua_tag should return LUA_NOTAG (-2) when given a non-valid index, but actually returns -1. lapi.c: 134c134 < luaT_effectivetag(L, o)), -1); --- > luaT_effectivetag(L, o)), LUA_NOTAG); -- Paul Hankin