Fixed bug in node deletion.
Handled the deletion of the source and target array entries on delete of
a node.