Avoid the same node being added multiple times (fixes #65).

When trying to add a node that already exists, the existing node is edited
instead.