Fix two bugs in the same place. One is that we're checking against the wrong LX_OP. The other is a use-after-free bug, in that the (wrong) one we're using has, under some circumstances, been freed by the time we use it.