Fixing bug in which we would try to de-reference a null pointer if using has on a root node.