Fixed a bug with edge adding.
Added a function to test the existance of a node.