more cleanup, fixed crash when trying to delete node from diagram that does not have root node