Fix handling of logic ops.

op_other does not necessarily point to a kid of the logic op, and
all kids can be found starting from op_first anyway.