Created safe LuaReference class.