Add check that we actually encountered the op while traversing the tree.