Index: src/hugo/list_graph.h
===================================================================
--- src/hugo/list_graph.h	(revision 578)
+++ src/hugo/list_graph.h	(revision 579)
@@ -95,7 +95,4 @@
     class InEdgeIt;
     
-    template <typename T> class NodeMap;
-    template <typename T> class EdgeMap;
-    
   public:
 
@@ -329,4 +326,6 @@
       NodeIt(Invalid i) : Node(i) { }
       NodeIt(const ListGraph& G) : Node(G.first_node) { }
+      ///\todo Undocumented conversion Node -\> NodeIt.
+      NodeIt(const ListGraph& G, const Node &n) : Node(n) { }
     };
 
@@ -483,4 +482,5 @@
     template <typename T> class EdgeMap : public DynMapBase<Edge>
     {
+    protected:
       std::vector<T> container;
 
@@ -945,6 +945,10 @@
       friend class NodeSet;
     public:
+      NodeIt() : Node() { }
+      NodeIt(Invalid i) : Node(i) { }
       NodeIt(const NodeSet& G) : Node(G.first_node) { }
-      NodeIt() : Node() { }
+      ///\todo Undocumented conversion Node -\> NodeIt.
+      NodeIt(const NodeSet& G, const Node &n) : Node(n) { }
+
     };
 
@@ -1183,4 +1187,8 @@
       NodeIt(const typename NodeGraphType::NodeIt &n)
 	: NodeGraphType::NodeIt(n) {}
+      ///\todo Undocumented conversion Node -\> NodeIt.
+      NodeIt(const EdgeSet& _G, const Node &n)
+	: NodeGraphType::NodeIt(_G.G,n) { }
+
       operator Node() { return Node(*this);}
     };
@@ -1327,6 +1335,6 @@
       }
       else {
-	NodeIt n;
-	for(n=next(edges[it.n].head);
+	NodeIt n(*this,edges[it.n].head);
+	for(n=next(n);
 	    valid(n) && nodes[n].first_in == -1;
 	    next(n)) ;
@@ -1339,5 +1347,5 @@
 
     /// Adds a new node to the graph.
-    Node addNode() { return G.AddNode(); }
+    Node addNode() { return G.addNode(); }
     
     Edge addEdge(Node u, Node v) {
@@ -1410,4 +1418,11 @@
     void erase(Edge e) { eraseEdge(e.n); }
 
+    ///Clear all edges. (Doesn't clear the nodes!)
+    void clear() {
+      edges.clear();
+      first_free_edge=-1;
+    }
+
+
 //     //\bug Dynamic maps must be updated!
 //     //
@@ -1417,15 +1432,20 @@
 //     }
 
+  public:
+    template <typename T> class EdgeMap;
+    
+    ///
     class Edge {
+    public:
       friend class EdgeSet;
       template <typename T> friend class EdgeMap;
 
-      //template <typename T> friend class SymEdgeSet::SymEdgeMap;      
-      //friend Edge SymEdgeSet::opposite(Edge) const;
-      
       friend class Node;
       friend class NodeIt;
+    public:
+      ///\bug It shoud be at least protected
+      ///
+      int n;
     protected:
-      int n;
       friend int EdgeSet::id(Edge e) const;
 
@@ -1445,4 +1465,7 @@
     class EdgeIt : public Edge {
       friend class EdgeSet;
+      template <typename T> friend class EdgeMap;
+    
+      
     public:
       EdgeIt(const EdgeSet& G) : Edge() {
@@ -1467,5 +1490,5 @@
       OutEdgeIt (Invalid i) : Edge(i) { }
 
-      OutEdgeIt(const EdgeSet& G,const Node v) : Edge(nodes[v].first_out) { }
+      OutEdgeIt(const EdgeSet& G,const Node v) : Edge(G.nodes[v].first_out) { }
     };
     
@@ -1475,5 +1498,5 @@
       InEdgeIt() : Edge() { }
       InEdgeIt (Invalid i) : Edge(i) { }
-      InEdgeIt(const EdgeSet& G,Node v) :Edge(nodes[v].first_in) { }
+      InEdgeIt(const EdgeSet& G,Node v) :Edge(G.nodes[v].first_in) { }
     };
 
@@ -1481,12 +1504,12 @@
       public NodeGraphType::template NodeMap<T>
     {
-    public:
-      NodeMap(const EdgeSet &_G) :
-        NodeGraphType::NodeMap(_G.G) { } //AJAJJ <T> would be wrong!!!
-      NodeMap(const EdgeSet &_G,const T &t) :
-	NodeGraphType::NodeMap(_G.G,t) { }
+      //This is a must, the constructors need it.
+      typedef typename NodeGraphType::template NodeMap<T> ParentNodeMap;
+    public:
+      NodeMap(const EdgeSet &_G) : ParentNodeMap(_G.G) { }
+      NodeMap(const EdgeSet &_G,const T &t) : ParentNodeMap(_G.G,t) { }
       //It is unnecessary
       NodeMap(const typename NodeGraphType::template NodeMap<T> &m) :
-	NodeGraphType::NodeMap(m) { }
+	ParentNodeMap(m) { }
 
       ///\todo It can copy between different types.
@@ -1494,9 +1517,14 @@
       template<typename TT>
       NodeMap(const typename NodeGraphType::template NodeMap<TT> &m)
-	: NodeGraphType::NodeMap(m) { }
-    };
-    
+	: ParentNodeMap(m) { }
+    };
+    
+    ///
     template <typename T> class EdgeMap : public DynMapBase<Edge>
     {
+    protected:
+    public:
+      ///\bug It should be at least protected
+      ///
       std::vector<T> container;
 
@@ -1558,10 +1586,16 @@
       void erase(const Edge) { }
       
-      void set(Edge n, T a) { container[n.n]=a; }
+      ///\bug This doesn't work. Why?
+      ///      void set(Edge n, T a) { container[n.n]=a; }
+      void set(Edge n, T a) { container[G->id(n)]=a; }
       //T get(Edge n) const { return container[n.n]; }
       typename std::vector<T>::reference
-      operator[](Edge n) { return container[n.n]; }
+      ///\bug This doesn't work. Why?
+      ///      operator[](Edge n) { return container[n.n]; }
+      operator[](Edge n) { return container[G->id(n)]; }
       typename std::vector<T>::const_reference
-      operator[](Edge n) const { return container[n.n]; }
+      ///\bug This doesn't work. Why?
+      ///      operator[](Edge n) const { return container[n.n]; }
+      operator[](Edge n) const { return container[G->id(n)]; }
 
       ///\warning There is no safety check at all!
@@ -1575,4 +1609,7 @@
 	return *this;
       }
+      
+      template<typename TT> friend class EdgeMap;
+
       template<typename TT>
       const EdgeMap<T>& operator=(const EdgeMap<TT> &m)
@@ -1588,6 +1625,6 @@
   };
 
-  template< typename GG>
-  int EdgeSet<GG>::id(Node v) const { return G.id(v); }
+  template<typename GG>
+  inline int EdgeSet<GG>::id(Node v) const { return G.id(v); }
 
 /// @}  
Index: src/hugo/smart_graph.h
===================================================================
--- src/hugo/smart_graph.h	(revision 542)
+++ src/hugo/smart_graph.h	(revision 579)
@@ -221,4 +221,6 @@
       NodeIt(Invalid i) : Node(i) { }
       NodeIt(const SmartGraph& G) : Node(G.nodes.size()?0:-1) { }
+      ///\todo Undocumented conversion Node -\> NodeIt.
+      NodeIt(const SmartGraph& G, const Node &n) : Node(n) { }
     };
 
