Updating addNode to properly handle discrete graph components.