No need to call lua_getglobal(L, k), lua_xmove(L, L1, 1), lua_getglobal(L1, k)