changed Node::compare to return -1 if the two nodes type is incompatible