Good suggestions. I've fixed these up, and added comments specifically highlighting this behaviour only applies if the supplied element is accepted by the node filter.