Fixed bug with lua_pop being called when using luaL_ref