Index: tools/Makefile.am
===================================================================
--- tools/Makefile.am	(revision 721)
+++ 	(revision )
@@ -1,17 +1,0 @@
-EXTRA_DIST += \
-	tools/CMakeLists.txt
-
-if WANT_TOOLS
-
-bin_PROGRAMS += \
-	tools/dimacs-solver \
-	tools/dimacs-to-lgf \
-	tools/lgf-gen
-
-dist_bin_SCRIPTS += tools/lemon-0.x-to-1.x.sh
-
-endif WANT_TOOLS
-
-tools_dimacs_solver_SOURCES = tools/dimacs-solver.cc
-tools_dimacs_to_lgf_SOURCES = tools/dimacs-to-lgf.cc
-tools_lgf_gen_SOURCES = tools/lgf-gen.cc
Index: tools/dimacs-solver.cc
===================================================================
--- tools/dimacs-solver.cc	(revision 1169)
+++ tools/dimacs-solver.cc	(revision 1386)
@@ -3,5 +3,5 @@
  * This file is a part of LEMON, a generic C++ optimization library.
  *
- * Copyright (C) 2003-2010
+ * Copyright (C) 2003-2013
  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
  * (Egervary Research Group on Combinatorial Optimization, EGRES).
@@ -128,5 +128,6 @@
   if (report) {
     std::cerr << "Run NetworkSimplex: " << ti << "\n\n";
-    std::cerr << "Feasible flow: " << (res == MCF::OPTIMAL ? "found" : "not found") << '\n';
+    std::cerr << "Feasible flow: " << (res == MCF::OPTIMAL ? "found" :
+                                       "not found") << '\n';
     if (res) std::cerr << "Min flow cost: "
                        << ns.template totalCost<LargeValue>() << '\n';
@@ -222,4 +223,5 @@
         throw IoError("Cannot open the file for writing", ap.files()[1]);
       }
+      // fall through
     case 1:
       input.open(ap.files()[0].c_str());
@@ -227,4 +229,5 @@
         throw IoError("File cannot be found", ap.files()[0]);
       }
+      // fall through
     case 0:
       break;
@@ -251,4 +254,5 @@
         case DimacsDescriptor::SP:
           std::cout << "sp";
+          break;
         case DimacsDescriptor::MAT:
           std::cout << "mat";
Index: tools/lgf-gen.cc
===================================================================
--- tools/lgf-gen.cc	(revision 1308)
+++ tools/lgf-gen.cc	(revision 701)
@@ -247,5 +247,5 @@
   struct BeachIt;
 
-  typedef std::multimap<double, BeachIt*> SpikeHeap;
+  typedef std::multimap<double, BeachIt> SpikeHeap;
 
   typedef std::multimap<Part, SpikeHeap::iterator, YLess> Beach;
@@ -330,5 +330,4 @@
 
       if (bit->second != spikeheap.end()) {
-        delete bit->second->second;
         spikeheap.erase(bit->second);
       }
@@ -344,6 +343,6 @@
           circle_form(points[prev], points[curr], points[site])) {
         double x = circle_point(points[prev], points[curr], points[site]);
-        pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
-        pit->second->it =
+        pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
+        pit->second.it =
           beach.insert(std::make_pair(Part(prev, curr, site), pit));
       } else {
@@ -357,6 +356,6 @@
           circle_form(points[site], points[curr],points[next])) {
         double x = circle_point(points[site], points[curr], points[next]);
-        nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
-        nit->second->it =
+        nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
+        nit->second.it =
           beach.insert(std::make_pair(Part(site, curr, next), nit));
       } else {
@@ -368,5 +367,5 @@
       sweep = spit->first;
 
-      Beach::iterator bit = spit->second->it;
+      Beach::iterator bit = spit->second.it;
 
       int prev = bit->first.prev;
@@ -401,20 +400,8 @@
       int nnt = nbit->first.next;
 
-      if (bit->second != spikeheap.end())
-        {
-          delete bit->second->second;
-          spikeheap.erase(bit->second);
-        }
-      if (pbit->second != spikeheap.end())
-        {
-          delete pbit->second->second;
-          spikeheap.erase(pbit->second);
-        }
-      if (nbit->second != spikeheap.end())
-        {
-          delete nbit->second->second;
-          spikeheap.erase(nbit->second);
-        }
-      
+      if (bit->second != spikeheap.end()) spikeheap.erase(bit->second);
+      if (pbit->second != spikeheap.end()) spikeheap.erase(pbit->second);
+      if (nbit->second != spikeheap.end()) spikeheap.erase(nbit->second);
+
       beach.erase(nbit);
       beach.erase(bit);
@@ -426,6 +413,6 @@
         double x = circle_point(points[ppv], points[prev], points[next]);
         if (x < sweep) x = sweep;
-        pit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
-        pit->second->it =
+        pit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
+        pit->second.it =
           beach.insert(std::make_pair(Part(ppv, prev, next), pit));
       } else {
@@ -438,6 +425,6 @@
         double x = circle_point(points[prev], points[next], points[nnt]);
         if (x < sweep) x = sweep;
-        nit = spikeheap.insert(std::make_pair(x, new BeachIt(beach.end())));
-        nit->second->it =
+        nit = spikeheap.insert(std::make_pair(x, BeachIt(beach.end())));
+        nit->second.it =
           beach.insert(std::make_pair(Part(prev, next, nnt), nit));
       } else {
