Updates pytree to also accept Node instance instead of nid in some functions. This solves a bug in add_node()