Better handling of nid while deleting a node.