Index: lemon/lemon_reader.h
===================================================================
--- lemon/lemon_reader.h	(revision 1746)
+++ lemon/lemon_reader.h	(revision 1845)
@@ -46,4 +46,16 @@
   namespace _reader_bits {
 
+    template <typename T>
+    bool operator<(T, T) {
+      throw DataFormatError("Id is not comparable");
+    }
+
+    template <typename T>
+    struct Less {
+      bool operator()(const T& p, const T& q) const {
+	return p < q;
+      }
+    };
+
     template <typename Item>
     class ItemIdReader {
@@ -84,16 +96,4 @@
 
     };
-  
-    template <typename T>
-    bool operator<(T, T) {
-      throw DataFormatError("Id is not comparable");
-    }
-
-    template <typename T>
-    struct Less {
-      bool operator()(const T& p, const T& q) const {
-	return p < q;
-      }
-    };
 
     template <typename Map>
@@ -197,4 +197,251 @@
     struct Arg<YMap<Map> > { 
       typedef const YMap<Map>& Type;
+    };
+
+
+    template <typename _Item>
+    class MapReaderBase;
+    
+    template <typename _Item>
+    class MapInverterBase : public MapReaderBase<_Item> {
+    public:
+      typedef _Item Item;
+      virtual void read(std::istream&, const Item&) = 0;
+      virtual Item read(std::istream&) const = 0;
+
+      virtual MapInverterBase<_Item>* getInverter() {
+	return this;
+      }
+    };
+
+    template <typename _Item, typename _Map, typename _Reader>
+    class MapReaderInverter : public MapInverterBase<_Item> {
+    public:
+      typedef _Item Item;
+      typedef _Reader Reader;
+      typedef typename Reader::Value Value;
+      typedef _Map Map;
+      typedef std::map<Value, Item, _reader_bits::Less<Value> > Inverse;
+
+      typename _reader_bits::Ref<Map>::Type map;
+      Reader reader;
+      Inverse inverse;
+
+      MapReaderInverter(typename _reader_bits::Arg<Map>::Type _map,
+			const Reader& _reader) 
+	: map(_map), reader(_reader) {}
+
+      virtual ~MapReaderInverter() {}
+
+      virtual void read(std::istream& is, const Item& item) {
+	Value value;
+	reader.read(is, value);
+	map.set(item, value);
+	typename Inverse::iterator it = inverse.find(value);
+	if (it == inverse.end()) {
+	  inverse.insert(std::make_pair(value, item));
+	} else {
+	  throw DataFormatError("Multiple ID occurence");
+	}
+      }
+
+      virtual Item read(std::istream& is) const {
+	Value value;
+	reader.read(is, value);	
+	typename Inverse::const_iterator it = inverse.find(value);
+	if (it != inverse.end()) {
+	  return it->second;
+	} else {
+	  throw DataFormatError("Invalid ID error");
+	}
+      }      
+    };
+
+    template <typename _Item, typename _Reader>
+    class SkipReaderInverter : public MapInverterBase<_Item> {
+    public:
+      typedef _Item Item;
+      typedef _Reader Reader;
+      typedef typename Reader::Value Value;
+      typedef std::map<Value, Item, _reader_bits::Less<Value> > Inverse;
+
+      Reader reader;
+
+      SkipReaderInverter(const Reader& _reader) 
+	: reader(_reader) {}
+
+      virtual ~SkipReaderInverter() {}
+
+      virtual void read(std::istream& is, const Item& item) {
+	Value value;
+	reader.read(is, value);
+	typename Inverse::iterator it = inverse.find(value);
+	if (it == inverse.end()) {
+	  inverse.insert(std::make_pair(value, item));
+	} else {
+	  throw DataFormatError("Multiple ID occurence error");
+	}
+      }
+
+      virtual Item read(std::istream& is) const {
+	Value value;
+	reader.read(is, value);	
+	typename Inverse::const_iterator it = inverse.find(value);
+	if (it != inverse.end()) {
+	  return it->second;
+	} else {
+	  throw DataFormatError("Invalid ID error");
+	}
+      }
+
+    private:
+      Inverse inverse;
+    };
+
+    template <typename _Item>    
+    class MapReaderBase {
+    public:
+      typedef _Item Item;
+
+      MapReaderBase() { _touched = false; }
+      
+      void touch() { _touched = true; }
+      bool touched() const { return _touched; }
+
+      virtual ~MapReaderBase() {}
+
+      virtual void read(std::istream& is, const Item& item) = 0;
+      virtual MapInverterBase<_Item>* getInverter() = 0;
+
+    private:      
+      bool _touched;
+
+    };
+
+    template <typename _Item, typename _Map, typename _Reader>
+    class MapReader : public MapReaderBase<_Item> {
+    public:
+      typedef _Map Map;
+      typedef _Reader Reader;
+      typedef typename Reader::Value Value;
+      typedef _Item Item;
+      
+      typename _reader_bits::Ref<Map>::Type map;
+      Reader reader;
+
+      MapReader(typename _reader_bits::Arg<Map>::Type _map, 
+		const Reader& _reader) 
+	: map(_map), reader(_reader) {}
+
+      virtual ~MapReader() {}
+
+      virtual void read(std::istream& is, const Item& item) {
+	Value value;
+	reader.read(is, value);
+	map.set(item, value);
+      }
+
+      virtual MapInverterBase<_Item>* getInverter() {
+	return new MapReaderInverter<Item, Map, Reader>(map, reader);
+      }
+    };
+
+
+    template <typename _Item, typename _Reader>
+    class SkipReader : public MapReaderBase<_Item> {
+    public:
+      typedef _Reader Reader;
+      typedef typename Reader::Value Value;
+      typedef _Item Item;
+
+      Reader reader;
+      SkipReader(const Reader& _reader) : reader(_reader) {}
+
+      virtual ~SkipReader() {}
+
+      virtual void read(std::istream& is, const Item&) {
+	Value value;
+	reader.read(is, value);
+      }      
+
+      virtual MapInverterBase<Item>* getInverter() {
+	return new SkipReaderInverter<Item, Reader>(reader);
+      }
+    };
+
+    template <typename _Item>
+    class IdReaderBase {
+    public:
+      typedef _Item Item;
+      virtual ~IdReaderBase() {}
+      virtual Item read(std::istream& is) const = 0;
+      virtual bool isIdReader() const = 0;
+    };
+
+    template <typename _Item, typename _BoxedIdReader>
+    class IdReader : public IdReaderBase<_Item> {
+    public:
+      typedef _Item Item;
+      typedef _BoxedIdReader BoxedIdReader;
+      
+      const BoxedIdReader& boxedIdReader;
+
+      IdReader(const BoxedIdReader& _boxedIdReader) 
+	: boxedIdReader(_boxedIdReader) {}
+
+      virtual Item read(std::istream& is) const {
+	Item item;
+	boxedIdReader.readId(is, item);
+	return item;
+      }
+
+      virtual bool isIdReader() const {
+	return boxedIdReader.isIdReader();
+      }
+    };
+
+    template <typename _Item>
+    class ItemStore {
+    public:
+
+      typedef _Item Item;
+
+      ItemStore(Item& _item) : item(&_item) { 
+	_touched = false; 
+      }
+      
+      void touch() { _touched = true; }
+      bool touched() const { return _touched; }
+
+      void read(const Item& _item) {
+	*item = _item;
+      }
+      
+    private:
+      Item* item;
+      bool _touched;
+    };
+
+    class ValueReaderBase {
+    public:
+      virtual void read(std::istream&) {};
+      virtual ~ValueReaderBase() {}
+    };
+
+    template <typename _Value, typename _Reader>
+    class ValueReader : public ValueReaderBase {
+    public:
+      typedef _Value Value;
+      typedef _Reader Reader;
+
+      ValueReader(Value& _value, const Reader& _reader)
+ 	: value(_value), reader(_reader) {}
+
+      virtual void read(std::istream& is) {
+	reader.read(is, value);
+      }
+    private:
+      Value& value;
+      Reader reader;
     };
 
@@ -470,235 +717,4 @@
   };
 
-  /// \brief Helper class for implementing the common SectionReaders.
-  ///
-  /// Helper class for implementing the common SectionReaders.
-  class CommonSectionReaderBase : public LemonReader::SectionReader {
-    typedef LemonReader::SectionReader Parent;
-  protected:
-    
-    /// \brief Constructor for CommonSectionReaderBase.
-    ///
-    /// Constructor for CommonSectionReaderBase. It attach this reader to
-    /// the given LemonReader.
-    CommonSectionReaderBase(LemonReader& _reader) 
-      : Parent(_reader) {}
-
-    template <typename _Item>
-    class ReaderBase;
-    
-    template <typename _Item>
-    class InverterBase : public ReaderBase<_Item> {
-    public:
-      typedef _Item Item;
-      virtual void read(std::istream&, const Item&) = 0;
-      virtual Item read(std::istream&) const = 0;
-
-      virtual InverterBase<_Item>* getInverter() {
-	return this;
-      }
-    };
-
-    template <typename _Item, typename _Map, typename _Reader>
-    class MapReaderInverter : public InverterBase<_Item> {
-    public:
-      typedef _Item Item;
-      typedef _Reader Reader;
-      typedef typename Reader::Value Value;
-      typedef _Map Map;
-      typedef std::map<Value, Item, _reader_bits::Less<Value> > Inverse;
-
-      typename _reader_bits::Ref<Map>::Type map;
-      Reader reader;
-      Inverse inverse;
-
-      MapReaderInverter(typename _reader_bits::Arg<Map>::Type _map,
-			const Reader& _reader) 
-	: map(_map), reader(_reader) {}
-
-      virtual ~MapReaderInverter() {}
-
-      virtual void read(std::istream& is, const Item& item) {
-	Value value;
-	reader.read(is, value);
-	map.set(item, value);
-	typename Inverse::iterator it = inverse.find(value);
-	if (it == inverse.end()) {
-	  inverse.insert(std::make_pair(value, item));
-	} else {
-	  throw DataFormatError("Multiple ID occurence");
-	}
-      }
-
-      virtual Item read(std::istream& is) const {
-	Value value;
-	reader.read(is, value);	
-	typename Inverse::const_iterator it = inverse.find(value);
-	if (it != inverse.end()) {
-	  return it->second;
-	} else {
-	  throw DataFormatError("Invalid ID error");
-	}
-      }      
-    };
-
-    template <typename _Item, typename _Reader>
-    class SkipReaderInverter : public InverterBase<_Item> {
-    public:
-      typedef _Item Item;
-      typedef _Reader Reader;
-      typedef typename Reader::Value Value;
-      typedef std::map<Value, Item, _reader_bits::Less<Value> > Inverse;
-
-      Reader reader;
-
-      SkipReaderInverter(const Reader& _reader) 
-	: reader(_reader) {}
-
-      virtual ~SkipReaderInverter() {}
-
-      virtual void read(std::istream& is, const Item& item) {
-	Value value;
-	reader.read(is, value);
-	typename Inverse::iterator it = inverse.find(value);
-	if (it == inverse.end()) {
-	  inverse.insert(std::make_pair(value, item));
-	} else {
-	  throw DataFormatError("Multiple ID occurence error");
-	}
-      }
-
-      virtual Item read(std::istream& is) const {
-	Value value;
-	reader.read(is, value);	
-	typename Inverse::const_iterator it = inverse.find(value);
-	if (it != inverse.end()) {
-	  return it->second;
-	} else {
-	  throw DataFormatError("Invalid ID error");
-	}
-      }
-
-    private:
-      Inverse inverse;
-    };
-
-    template <typename _Item>    
-    class ReaderBase {
-    public:
-      typedef _Item Item;
-
-      virtual ~ReaderBase() {}
-
-      virtual void read(std::istream& is, const Item& item) = 0;
-      virtual InverterBase<_Item>* getInverter() = 0;
-    };
-
-    template <typename _Item, typename _Map, typename _Reader>
-    class MapReader : public ReaderBase<_Item> {
-    public:
-      typedef _Map Map;
-      typedef _Reader Reader;
-      typedef typename Reader::Value Value;
-      typedef _Item Item;
-      
-      typename _reader_bits::Ref<Map>::Type map;
-      Reader reader;
-
-      MapReader(typename _reader_bits::Arg<Map>::Type _map, 
-		const Reader& _reader) 
-	: map(_map), reader(_reader) {}
-
-      virtual ~MapReader() {}
-
-      virtual void read(std::istream& is, const Item& item) {
-	Value value;
-	reader.read(is, value);
-	map.set(item, value);
-      }
-
-      virtual InverterBase<_Item>* getInverter() {
-	return new MapReaderInverter<Item, Map, Reader>(map, reader);
-      }
-    };
-
-
-    template <typename _Item, typename _Reader>
-    class SkipReader : public ReaderBase<_Item> {
-    public:
-      typedef _Reader Reader;
-      typedef typename Reader::Value Value;
-      typedef _Item Item;
-
-      Reader reader;
-      SkipReader(const Reader& _reader) : reader(_reader) {}
-
-      virtual ~SkipReader() {}
-
-      virtual void read(std::istream& is, const Item&) {
-	Value value;
-	reader.read(is, value);
-      }      
-
-      virtual InverterBase<Item>* getInverter() {
-	return new SkipReaderInverter<Item, Reader>(reader);
-      }
-    };
-
-    template <typename _Item>
-    class IdReaderBase {
-    public:
-      typedef _Item Item;
-      virtual ~IdReaderBase() {}
-      virtual Item read(std::istream& is) const = 0;
-      virtual bool isIdReader() const = 0;
-    };
-
-    template <typename _Item, typename _BoxedIdReader>
-    class IdReader : public IdReaderBase<_Item> {
-    public:
-      typedef _Item Item;
-      typedef _BoxedIdReader BoxedIdReader;
-      
-      const BoxedIdReader& boxedIdReader;
-
-      IdReader(const BoxedIdReader& _boxedIdReader) 
-	: boxedIdReader(_boxedIdReader) {}
-
-      virtual Item read(std::istream& is) const {
-	Item item;
-	boxedIdReader.readId(is, item);
-	return item;
-      }
-
-      virtual bool isIdReader() const {
-	return boxedIdReader.isIdReader();
-      }
-    };
-
-    class ValueReaderBase {
-    public:
-      virtual void read(std::istream&) {};
-      virtual ~ValueReaderBase() {}
-    };
-
-    template <typename _Value, typename _Reader>
-    class ValueReader : public ValueReaderBase {
-    public:
-      typedef _Value Value;
-      typedef _Reader Reader;
-
-      ValueReader(Value& _value, const Reader& _reader)
- 	: value(_value), reader(_reader) {}
-
-      virtual void read(std::istream& is) {
-	reader.read(is, value);
-      }
-    private:
-      Value& value;
-      Reader reader;
-    };
-    
-  };
-
   /// \ingroup io_group
   /// \brief SectionReader for reading a graph's nodeset.
@@ -719,6 +735,6 @@
   /// \relates LemonReader
   template <typename _Graph, typename _Traits = DefaultReaderTraits>
-  class NodeSetReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class NodeSetReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
   public:
 
@@ -802,7 +818,8 @@
 	msg << "Multiple read rule for node map: " << name;
 	throw IOParameterError(msg.message());
-      }
+      }      
       readers.insert(
-	make_pair(name, new MapReader<Node, Map, Reader>(map, reader)));
+        make_pair(name, new _reader_bits::
+		  MapReader<Node, Map, Reader>(map, reader)));
       return *this;
     }
@@ -821,5 +838,6 @@
 	throw IOParameterError(msg.message());
       }
-      readers.insert(make_pair(name, new SkipReader<Node, Reader>(reader)));
+      readers.insert(make_pair(name, new _reader_bits::
+			       SkipReader<Node, Reader>(reader)));
       return *this;
     }
@@ -844,5 +862,5 @@
     /// It reads the content of the section.
     virtual void read(std::istream& is) {
-      std::vector<ReaderBase<Node>* > index;
+      std::vector<_reader_bits::MapReaderBase<Node>* > index;
       std::string line;
 
@@ -852,4 +870,5 @@
 	typename MapReaders::iterator it = readers.find(id);
 	if (it != readers.end()) {
+	  it->second->touch();
 	  index.push_back(it->second);
 	} else {
@@ -859,4 +878,12 @@
 	  inverter.reset(index.back()->getInverter());
 	  index.back() = inverter.get();
+	}
+      }
+      for (typename MapReaders::iterator it = readers.begin();
+	   it != readers.end(); ++it) {
+	if (!it->second->touched()) {
+	  ErrorMessage msg;
+	  msg << "Map not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
 	}
       }
@@ -890,12 +917,12 @@
   private:
 
-    typedef std::map<std::string, ReaderBase<Node>*> MapReaders;
+    typedef std::map<std::string, _reader_bits::MapReaderBase<Node>*> MapReaders;
     MapReaders readers;
    
     Graph& graph;   
     std::string id;
-    SkipReader<Node, DefaultSkipper> skipper;
-
-    std::auto_ptr<InverterBase<Node> > inverter;
+    _reader_bits::SkipReader<Node, DefaultSkipper> skipper;
+
+    std::auto_ptr<_reader_bits::MapInverterBase<Node> > inverter;
   };
 
@@ -923,6 +950,6 @@
   /// \relates LemonReader
   template <typename _Graph, typename _Traits = DefaultReaderTraits>
-  class EdgeSetReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class EdgeSetReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
   public:
 
@@ -949,5 +976,6 @@
       : Parent(_reader), graph(_graph), id(_id), skipper(_skipper) {
       checkConcept<_reader_bits::ItemIdReader<Node>, NodeIdReader>();
-      nodeIdReader.reset(new IdReader<Node, NodeIdReader>(_nodeIdReader));
+      nodeIdReader.reset(new _reader_bits::
+			 IdReader<Node, NodeIdReader>(_nodeIdReader));
     }
     /// \brief Destructor.
@@ -1014,5 +1042,6 @@
       }
       readers.insert(
-	make_pair(name, new MapReader<Edge, Map, Reader>(map, reader)));
+	make_pair(name, new _reader_bits::
+		  MapReader<Edge, Map, Reader>(map, reader)));
       return *this;
     }
@@ -1031,5 +1060,6 @@
 	throw IOParameterError(msg.message());
       }
-      readers.insert(make_pair(name, new SkipReader<Edge, Reader>(reader)));
+      readers.insert(make_pair(name, new _reader_bits::
+			       SkipReader<Edge, Reader>(reader)));
       return *this;
     }
@@ -1057,5 +1087,5 @@
 	throw DataFormatError("Cannot find nodeset or ID map");
       }
-      std::vector<ReaderBase<Edge>* > index;
+      std::vector<_reader_bits::MapReaderBase<Edge>* > index;
       std::string line;
 
@@ -1066,4 +1096,5 @@
 	if (it != readers.end()) {
 	  index.push_back(it->second);
+	  it->second->touch();
 	} else {
 	  index.push_back(&skipper);
@@ -1072,4 +1103,12 @@
 	  inverter.reset(index.back()->getInverter());
 	  index.back() = inverter.get();
+	}
+      }
+      for (typename MapReaders::iterator it = readers.begin();
+	   it != readers.end(); ++it) {
+	if (!it->second->touched()) {
+	  ErrorMessage msg;
+	  msg << "Map not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
 	}
       }
@@ -1105,13 +1144,13 @@
   private:
 
-    typedef std::map<std::string, ReaderBase<Edge>*> MapReaders;
+    typedef std::map<std::string, _reader_bits::MapReaderBase<Edge>*> MapReaders;
     MapReaders readers;
    
     Graph& graph;   
     std::string id;
-    SkipReader<Edge, DefaultSkipper> skipper;
-
-    std::auto_ptr<InverterBase<Edge> > inverter;
-    std::auto_ptr<IdReaderBase<Node> > nodeIdReader;
+    _reader_bits::SkipReader<Edge, DefaultSkipper> skipper;
+
+    std::auto_ptr<_reader_bits::MapInverterBase<Edge> > inverter;
+    std::auto_ptr<_reader_bits::IdReaderBase<Node> > nodeIdReader;
   };
 
@@ -1144,6 +1183,6 @@
   /// \relates LemonReader
   template <typename _Graph, typename _Traits = DefaultReaderTraits>
-  class UndirEdgeSetReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class UndirEdgeSetReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
   public:
 
@@ -1171,5 +1210,6 @@
       : Parent(_reader), graph(_graph), id(_id), skipper(_skipper) {
       checkConcept<_reader_bits::ItemIdReader<Node>, NodeIdReader>();
-      nodeIdReader.reset(new IdReader<Node, NodeIdReader>(_nodeIdReader));
+      nodeIdReader.reset(new _reader_bits::
+			 IdReader<Node, NodeIdReader>(_nodeIdReader));
     }
     /// \brief Destructor.
@@ -1236,5 +1276,6 @@
       }
       readers.insert(
-	make_pair(name, new MapReader<UndirEdge, Map, Reader>(map, reader)));
+	make_pair(name, new _reader_bits::
+		  MapReader<UndirEdge, Map, Reader>(map, reader)));
       return *this;
     }
@@ -1253,6 +1294,6 @@
 	throw IOParameterError(msg.message());
       }
-      readers.insert(make_pair(name, 
-			       new SkipReader<UndirEdge, Reader>(reader)));
+      readers.insert(make_pair(name, new _reader_bits::
+			       SkipReader<UndirEdge, Reader>(reader)));
       return *this;
     }
@@ -1341,5 +1382,5 @@
 	throw DataFormatError("Cannot find nodeset or ID map");
       }
-      std::vector<ReaderBase<UndirEdge>* > index;
+      std::vector<_reader_bits::MapReaderBase<UndirEdge>* > index;
       std::string line;
 
@@ -1350,4 +1391,5 @@
 	if (it != readers.end()) {
 	  index.push_back(it->second);
+	  it->second->touch();
 	} else {
 	  index.push_back(&skipper);
@@ -1356,4 +1398,12 @@
 	  inverter.reset(index.back()->getInverter());
 	  index.back() = inverter.get();
+	}
+      }
+      for (typename MapReaders::iterator it = readers.begin();
+	   it != readers.end(); ++it) {
+	if (!it->second->touched()) {
+	  ErrorMessage msg;
+	  msg << "Map not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
 	}
       }
@@ -1409,13 +1459,14 @@
   private:
 
-    typedef std::map<std::string, ReaderBase<UndirEdge>*> MapReaders;
+    typedef std::map<std::string, 
+		     _reader_bits::MapReaderBase<UndirEdge>*> MapReaders;
     MapReaders readers;
    
     Graph& graph;   
     std::string id;
-    SkipReader<UndirEdge, DefaultSkipper> skipper;
-
-    std::auto_ptr<InverterBase<UndirEdge> > inverter;
-    std::auto_ptr<IdReaderBase<Node> > nodeIdReader;
+    _reader_bits::SkipReader<UndirEdge, DefaultSkipper> skipper;
+
+    std::auto_ptr<_reader_bits::MapInverterBase<UndirEdge> > inverter;
+    std::auto_ptr<_reader_bits::IdReaderBase<Node> > nodeIdReader;
   };
 
@@ -1431,6 +1482,6 @@
   /// \relates LemonReader
   template <typename _Graph>
-  class NodeReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class NodeReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
     typedef _Graph Graph;
     typedef typename Graph::Node Node;
@@ -1448,5 +1499,6 @@
       : Parent(_reader), id(_id) {
       checkConcept<_reader_bits::ItemIdReader<Node>, _IdReader>();
-      nodeIdReader.reset(new IdReader<Node, _IdReader>(_idReader));
+      nodeIdReader.reset(new _reader_bits::
+			 IdReader<Node, _IdReader>(_idReader));
     }
 
@@ -1471,5 +1523,5 @@
 	throw IOParameterError(msg.message());
       }
-      readers.insert(make_pair(name, &item));
+      readers.insert(make_pair(name, _reader_bits::ItemStore<Node>(item)));
     }
 
@@ -1503,6 +1555,15 @@
 	typename NodeReaders::iterator it = readers.find(id);
 	if (it != readers.end()) {
-	  *(it->second) = nodeIdReader->read(ls); 
+	  it->second.read(nodeIdReader->read(ls));
+	  it->second.touch();
 	}	
+      }
+      for (typename NodeReaders::iterator it = readers.begin();
+	   it != readers.end(); ++it) {
+	if (!it->second.touched()) {
+	  ErrorMessage msg;
+	  msg << "Node not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
+	}
       }
     }
@@ -1512,7 +1573,7 @@
     std::string id;
 
-    typedef std::map<std::string, Node*> NodeReaders;
+    typedef std::map<std::string, _reader_bits::ItemStore<Node> > NodeReaders;
     NodeReaders readers;
-    std::auto_ptr<IdReaderBase<Node> > nodeIdReader;
+    std::auto_ptr<_reader_bits::IdReaderBase<Node> > nodeIdReader;
   };
 
@@ -1528,6 +1589,6 @@
   /// \relates LemonReader
   template <typename _Graph>
-  class EdgeReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class EdgeReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
     typedef _Graph Graph;
     typedef typename Graph::Edge Edge;
@@ -1545,5 +1606,6 @@
       : Parent(_reader), id(_id) {
       checkConcept<_reader_bits::ItemIdReader<Edge>, _IdReader>();
-      edgeIdReader.reset(new IdReader<Edge, _IdReader>(_idReader));
+      edgeIdReader.reset(new _reader_bits::
+			 IdReader<Edge, _IdReader>(_idReader));
     }
 
@@ -1567,5 +1629,5 @@
 	throw IOParameterError(msg.message());
       }
-      readers.insert(make_pair(name, &item));
+      readers.insert(make_pair(name, _reader_bits::ItemStore<Edge>(item)));
     }
 
@@ -1599,6 +1661,15 @@
 	typename EdgeReaders::iterator it = readers.find(id);
 	if (it != readers.end()) {
-	  *(it->second) = edgeIdReader->read(ls); 
+	  it->second.read(edgeIdReader->read(ls));
+	  it->second.touch();
 	}	
+      }
+      for (typename EdgeReaders::iterator it = readers.begin();
+	   it != readers.end(); ++it) {
+	if (!it->second.touched()) {
+	  ErrorMessage msg;
+	  msg << "Edge not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
+	}
       }
     }
@@ -1608,7 +1679,7 @@
     std::string id;
 
-    typedef std::map<std::string, Edge*> EdgeReaders;
+    typedef std::map<std::string, _reader_bits::ItemStore<Edge> > EdgeReaders;
     EdgeReaders readers;
-    std::auto_ptr<IdReaderBase<Edge> > edgeIdReader;
+    std::auto_ptr<_reader_bits::IdReaderBase<Edge> > edgeIdReader;
   };
 
@@ -1624,6 +1695,6 @@
   /// \relates LemonReader
   template <typename _Graph>
-  class UndirEdgeReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class UndirEdgeReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
     typedef _Graph Graph;
     typedef typename Graph::Edge Edge;
@@ -1644,6 +1715,8 @@
       checkConcept<_reader_bits::ItemIdReader<UndirEdge>, _IdReader>();
       checkConcept<_reader_bits::ItemIdReader<Edge>, _IdReader>();
-      undirEdgeIdReader.reset(new IdReader<UndirEdge, _IdReader>(_idReader));
-      edgeIdReader.reset(new IdReader<Edge, _IdReader>(_idReader));
+      undirEdgeIdReader.reset(new _reader_bits::
+			      IdReader<UndirEdge, _IdReader>(_idReader));
+      edgeIdReader.reset(new _reader_bits::
+			 IdReader<Edge, _IdReader>(_idReader));
     }
 
@@ -1667,5 +1740,6 @@
 	throw IOParameterError(msg.message());
       }
-      undirEdgeReaders.insert(make_pair(name, &item));
+      undirEdgeReaders.insert(make_pair(name, _reader_bits::
+					ItemStore<UndirEdge>(item)));
     }
 
@@ -1679,5 +1753,5 @@
 	throw IOParameterError(msg.message());
       }
-      edgeReaders.insert(make_pair(name, &item));
+      edgeReaders.insert(make_pair(name, _reader_bits::ItemStore<Edge>(item)));
     }
 
@@ -1715,13 +1789,31 @@
 	  typename UndirEdgeReaders::iterator it = undirEdgeReaders.find(id);
 	  if (it != undirEdgeReaders.end()) {
-	    *(it->second) = undirEdgeIdReader->read(ls); 
-	    break;
+	    it->second.read(undirEdgeIdReader->read(ls));
+	    it->second.touch();
+	    continue;
 	  }	
 	} {
 	  typename EdgeReaders::iterator it = edgeReaders.find(id);
 	  if (it != edgeReaders.end()) {
-	    *(it->second) = edgeIdReader->read(ls); 
-	    break;
+	    it->second.read(edgeIdReader->read(ls));
+	    it->second.touch();
+	    continue;
 	  }	
+	}
+      }
+      for (typename EdgeReaders::iterator it = edgeReaders.begin();
+	   it != edgeReaders.end(); ++it) {
+	if (!it->second.touched()) {
+	  ErrorMessage msg;
+	  msg << "Edge not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
+	}
+      }
+      for (typename UndirEdgeReaders::iterator it = undirEdgeReaders.begin();
+	   it != undirEdgeReaders.end(); ++it) {
+	if (!it->second.touched()) {
+	  ErrorMessage msg;
+	  msg << "UndirEdge not found in file: " << it->first;
+	  throw IOParameterError(msg.message());
 	}
       }
@@ -1732,11 +1824,12 @@
     std::string id;
 
-    typedef std::map<std::string, UndirEdge*> UndirEdgeReaders;
+    typedef std::map<std::string, 
+		     _reader_bits::ItemStore<UndirEdge> > UndirEdgeReaders;
     UndirEdgeReaders undirEdgeReaders;
-    std::auto_ptr<IdReaderBase<UndirEdge> > undirEdgeIdReader;
-
-    typedef std::map<std::string, Edge*> EdgeReaders;
+    std::auto_ptr<_reader_bits::IdReaderBase<UndirEdge> > undirEdgeIdReader;
+
+    typedef std::map<std::string, _reader_bits::ItemStore<Edge> > EdgeReaders;
     EdgeReaders edgeReaders;
-    std::auto_ptr<IdReaderBase<Edge> > edgeIdReader;
+    std::auto_ptr<_reader_bits::IdReaderBase<Edge> > edgeIdReader;
   };
 
@@ -1753,6 +1846,6 @@
   /// \relates LemonReader
   template <typename _Traits = DefaultReaderTraits>
-  class AttributeReader : public CommonSectionReaderBase {
-    typedef CommonSectionReaderBase Parent;
+  class AttributeReader : public LemonReader::SectionReader {
+    typedef LemonReader::SectionReader Parent;
     typedef _Traits Traits; 
   public:
@@ -1802,6 +1895,6 @@
 	throw IOParameterError(msg.message());
       }
-      readers.insert(make_pair(name, new ValueReader<Value, Reader>
-      			       (value, reader)));
+      readers.insert(make_pair(name, new _reader_bits::
+			       ValueReader<Value, Reader>(value, reader)));
       return *this;
     }
@@ -1841,5 +1934,5 @@
     std::string id;
 
-    typedef std::map<std::string, ValueReaderBase*> Readers;
+    typedef std::map<std::string, _reader_bits::ValueReaderBase*> Readers;
     Readers readers;  
   };
