Lua references are now correctly re-referenced