xpath BUGFIX adding hash of the root node
diff --git a/src/xpath.c b/src/xpath.c
index 0f1eaae..8fe2d51 100644
--- a/src/xpath.c
+++ b/src/xpath.c
@@ -701,14 +701,14 @@
             assert(!r);
             (void)r;
 
-            if (hnode.node == node) {
+            if ((hnode.node == node) && (hnode.type == type)) {
                 /* it was just added, do not add it twice */
-                node = NULL;
+                return;
             }
         }
     }
 
-    if (set->ht && node) {
+    if (set->ht) {
         /* add the new node into hash table */
         hnode.node = node;
         hnode.type = type;