Reorganized Lua Mob reference tracking to correct a logic error.