Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt	(revision 1327)
+++ CMakeLists.txt	(revision 1334)
@@ -1,7 +1,7 @@
-CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
-
-IF(POLICY CMP0048) 
-  CMAKE_POLICY(SET CMP0048 OLD) 
-ENDIF(POLICY CMP0048)
+CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
+
+IF(POLICY CMP0043) 
+  CMAKE_POLICY(SET CMP0043 OLD) 
+ENDIF(POLICY CMP0043)
 
 SET(PROJECT_NAME "LEMON")
@@ -126,7 +126,4 @@
   SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
     "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)" FORCE)
-ELSE()
-  SET(LEMON_DEFAULT_LP ${DEFAULT_LP} CACHE STRING
-    "Default LP solver backend (GLPK, CPLEX, CLP or SOPLEX)")
 ENDIF()
 IF(NOT LEMON_DEFAULT_MIP OR
@@ -136,7 +133,4 @@
   SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
     "Default MIP solver backend (GLPK, CPLEX or CBC)" FORCE)
-ELSE()
-  SET(LEMON_DEFAULT_MIP ${DEFAULT_MIP} CACHE STRING
-    "Default MIP solver backend (GLPK, CPLEX or CBC)")
 ENDIF()
 
@@ -151,11 +145,8 @@
   ELSEIF(MSVC)
     # This part is unnecessary 'casue the same is set by the lemon/core.h.
-    # Still kept as an example.
-
-    # SET(CXX_WARNING "/wd4250 /wd4267 /wd4355 /wd4503 /wd4800 /wd4996")
-
+    # Still keep it as an example.
+    SET(CXX_WARNING "/wd4250 /wd4355 /wd4503 /wd4800 /wd4996")
     # Suppressed warnings:
     # C4250: 'class1' : inherits 'class2::member' via dominance
-    # C4267: conversion from 'size_t' to 'type', possible loss of data
     # C4355: 'this' : used in base member initializer list
     # C4503: 'function' : decorated name length exceeded, name was truncated
@@ -172,5 +163,4 @@
 
 IF(MSVC)
-  SET(CMAKE_CXX_FLAGS "/bigobj ${CMAKE_CXX_FLAGS}")
   SET( CMAKE_CXX_FLAGS_MAINTAINER "/WX ${CMAKE_CXX_FLAGS_DEBUG}" CACHE STRING
     "Flags used by the C++ compiler during maintainer builds."
@@ -195,9 +185,9 @@
     )
   SET( CMAKE_EXE_LINKER_FLAGS_MAINTAINER
-    "${CMAKE_EXE_LINKER_FLAGS_DEBUG}" CACHE STRING
+    "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
     "Flags used for linking binaries during maintainer builds."
     )
   SET( CMAKE_SHARED_LINKER_FLAGS_MAINTAINER
-    "${CMAKE_SHARED_LINKER_FLAGS_DEBUG}" CACHE STRING
+    "-Wl,--warn-unresolved-symbols,--warn-once" CACHE STRING
     "Flags used by the shared libraries linker during maintainer builds."
     )
@@ -226,4 +216,8 @@
     FORCE )
 
+SET_DIRECTORY_PROPERTIES(PROPERTIES
+  COMPILE_DEFINITIONS_DEBUG "LEMON_ENABLE_DEBUG"
+  COMPILE_DEFINITIONS_MAINTAINER "LEMON_ENABLE_DEBUG"
+)
 
 INCLUDE(CheckTypeSize)
Index: cmake/FindILOG.cmake
===================================================================
--- cmake/FindILOG.cmake	(revision 1331)
+++ cmake/FindILOG.cmake	(revision 1232)
@@ -63,6 +63,4 @@
   ${ILOG_CPLEX_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
   ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
-  ${ILOG_CPLEX_ROOT_DIR}/lib/x86_linux/static_pic
-  ${ILOG_CPLEX_ROOT_DIR}/lib/x86-64_linux/static_pic
   ${ILOG_CPLEX_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
   NO_DEFAULT_PATH
@@ -75,6 +73,4 @@
   ${ILOG_CONCERT_ROOT_DIR}/lib/x86_debian4.0_4.1/static_pic
   ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_debian4.0_4.1/static_pic
-  ${ILOG_CONCERT_ROOT_DIR}/lib/x86_linux/static_pic
-  ${ILOG_CONCERT_ROOT_DIR}/lib/x86-64_linux/static_pic
   ${ILOG_CONCERT_ROOT_DIR}/lib/${ILOG_WIN_COMPILER}/stat_mda
   NO_DEFAULT_PATH
Index: lemon/CMakeLists.txt
===================================================================
--- lemon/CMakeLists.txt	(revision 1315)
+++ lemon/CMakeLists.txt	(revision 1264)
@@ -56,11 +56,6 @@
 
 ADD_LIBRARY(lemon ${LEMON_SOURCES})
-
-TARGET_LINK_LIBRARIES(lemon
-  ${GLPK_LIBRARIES} ${COIN_LIBRARIES} ${ILOG_LIBRARIES} ${SOPLEX_LIBRARIES}
-  )
-
 IF(UNIX)
-  SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon VERSION ${LEMON_VERSION} SOVERSION ${LEMON_VERSION})
+  SET_TARGET_PROPERTIES(lemon PROPERTIES OUTPUT_NAME emon)
 ENDIF()
 
Index: lemon/arg_parser.h
===================================================================
--- lemon/arg_parser.h	(revision 1327)
+++ lemon/arg_parser.h	(revision 959)
@@ -27,5 +27,4 @@
 #include <sstream>
 #include <algorithm>
-#include <lemon/core.h>
 #include <lemon/assert.h>
 
Index: lemon/capacity_scaling.h
===================================================================
--- lemon/capacity_scaling.h	(revision 1298)
+++ lemon/capacity_scaling.h	(revision 1270)
@@ -164,5 +164,5 @@
 
     // Parameters of the problem
-    bool _has_lower;
+    bool _have_lower;
     Value _sum_supply;
 
@@ -357,7 +357,8 @@
     template <typename LowerMap>
     CapacityScaling& lowerMap(const LowerMap& map) {
-      _has_lower = true;
+      _have_lower = true;
       for (ArcIt a(_graph); a != INVALID; ++a) {
         _lower[_arc_idf[a]] = map[a];
+        _lower[_arc_idb[a]] = map[a];
       }
       return *this;
@@ -543,5 +544,5 @@
         _cost[j] = _forward[j] ? 1 : -1;
       }
-      _has_lower = false;
+      _have_lower = false;
       return *this;
     }
@@ -754,5 +755,5 @@
       const Value MAX = std::numeric_limits<Value>::max();
       int last_out;
-      if (_has_lower) {
+      if (_have_lower) {
         for (int i = 0; i != _root; ++i) {
           last_out = _first_out[i+1];
@@ -839,9 +840,9 @@
     }
 
-    // Check if the upper bound is greater than or equal to the lower bound
-    // on each forward arc.
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
     bool checkBoundMaps() {
       for (int j = 0; j != _res_arc_num; ++j) {
-        if (_forward[j] && _upper[j] < _lower[j]) return false;
+        if (_upper[j] < _lower[j]) return false;
       }
       return true;
@@ -857,8 +858,8 @@
 
       // Handle non-zero lower bounds
-      if (_has_lower) {
+      if (_have_lower) {
         int limit = _first_out[_root];
         for (int j = 0; j != limit; ++j) {
-          if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
+          if (!_forward[j]) _res_cap[j] += _lower[j];
         }
       }
Index: lemon/config.h.in
===================================================================
--- lemon/config.h.in	(revision 1306)
+++ lemon/config.h.in	(revision 1264)
@@ -1,5 +1,4 @@
 #define LEMON_VERSION "@PROJECT_VERSION@"
 #cmakedefine LEMON_HAVE_LONG_LONG 1
-
 #cmakedefine LEMON_HAVE_LP 1
 #cmakedefine LEMON_HAVE_MIP 1
@@ -9,14 +8,6 @@
 #cmakedefine LEMON_HAVE_CLP 1
 #cmakedefine LEMON_HAVE_CBC 1
-
-#define _LEMON_CPLEX 1
-#define _LEMON_CLP 2
-#define _LEMON_GLPK 3
-#define _LEMON_SOPLEX 4
-#define _LEMON_CBC 5
-
-#cmakedefine LEMON_DEFAULT_LP _LEMON_@LEMON_DEFAULT_LP@
-#cmakedefine LEMON_DEFAULT_MIP _LEMON_@LEMON_DEFAULT_MIP@
-
+#cmakedefine LEMON_DEFAULT_LP @LEMON_DEFAULT_LP@
+#cmakedefine LEMON_DEFAULT_MIP @LEMON_DEFAULT_MIP@
 #cmakedefine LEMON_USE_PTHREAD 1
 #cmakedefine LEMON_USE_WIN32_THREADS 1
Index: lemon/core.h
===================================================================
--- lemon/core.h	(revision 1327)
+++ lemon/core.h	(revision 1270)
@@ -30,5 +30,4 @@
 // Disable the following warnings when compiling with MSVC:
 // C4250: 'class1' : inherits 'class2::member' via dominance
-// C4267: conversion from 'size_t' to 'type', possible loss of data
 // C4355: 'this' : used in base member initializer list
 // C4503: 'function' : decorated name length exceeded, name was truncated
@@ -36,8 +35,14 @@
 // C4996: 'function': was declared deprecated
 #ifdef _MSC_VER
-#pragma warning( disable : 4250 4267 4355 4503 4800 4996 )
+#pragma warning( disable : 4250 4355 4503 4800 4996 )
 #endif
 
-#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 8)
+#ifdef __GNUC__
+#define GCC_VERSION (__GNUC__ * 10000                   \
+                     + __GNUC_MINOR__ * 100             \
+                     + __GNUC_PATCHLEVEL__)
+#endif
+
+#if GCC_VERSION >= 40800
 // Needed by the [DI]GRAPH_TYPEDEFS marcos for gcc 4.8
 #pragma GCC diagnostic ignored "-Wunused-local-typedefs"
Index: lemon/cost_scaling.h
===================================================================
--- lemon/cost_scaling.h	(revision 1298)
+++ lemon/cost_scaling.h	(revision 1271)
@@ -257,5 +257,5 @@
 
     // Parameters of the problem
-    bool _has_lower;
+    bool _have_lower;
     Value _sum_supply;
     int _sup_node_num;
@@ -373,7 +373,8 @@
     template <typename LowerMap>
     CostScaling& lowerMap(const LowerMap& map) {
-      _has_lower = true;
+      _have_lower = true;
       for (ArcIt a(_graph); a != INVALID; ++a) {
         _lower[_arc_idf[a]] = map[a];
+        _lower[_arc_idb[a]] = map[a];
       }
       return *this;
@@ -568,5 +569,5 @@
         _scost[_reverse[j]] = 0;
       }
-      _has_lower = false;
+      _have_lower = false;
       return *this;
     }
@@ -780,5 +781,5 @@
       const Value MAX = std::numeric_limits<Value>::max();
       int last_out;
-      if (_has_lower) {
+      if (_have_lower) {
         for (int i = 0; i != _root; ++i) {
           last_out = _first_out[i+1];
@@ -837,5 +838,5 @@
         sup[n] = _supply[_node_id[n]];
       }
-      if (_has_lower) {
+      if (_have_lower) {
         for (ArcIt a(_graph); a != INVALID; ++a) {
           int j = _arc_idf[a];
@@ -907,9 +908,9 @@
     }
 
-    // Check if the upper bound is greater than or equal to the lower bound
-    // on each forward arc.
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
     bool checkBoundMaps() {
       for (int j = 0; j != _res_arc_num; ++j) {
-        if (_forward[j] && _upper[j] < _lower[j]) return false;
+        if (_upper[j] < _lower[j]) return false;
       }
       return true;
@@ -991,8 +992,8 @@
 
       // Handle non-zero lower bounds
-      if (_has_lower) {
+      if (_have_lower) {
         int limit = _first_out[_root];
         for (int j = 0; j != limit; ++j) {
-          if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
+          if (!_forward[j]) _res_cap[j] += _lower[j];
         }
       }
Index: lemon/counter.h
===================================================================
--- lemon/counter.h	(revision 1327)
+++ lemon/counter.h	(revision 833)
@@ -22,6 +22,4 @@
 #include <string>
 #include <iostream>
-
-#include <lemon/core.h>
 
 ///\ingroup timecount
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 1330)
+++ lemon/cplex.cc	(revision 1270)
@@ -116,8 +116,21 @@
                          ExprIterator e, Value ub) {
     int i = CPXgetnumrows(cplexEnv(), _prob);
-
-    int rmatbeg = 0;
-    
+    if (lb == -INF) {
+      const char s = 'L';
+      CPXnewrows(cplexEnv(), _prob, 1, &ub, &s, 0, 0);
+    } else if (ub == INF) {
+      const char s = 'G';
+      CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0);
+    } else if (lb == ub){
+      const char s = 'E';
+      CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, 0, 0);
+    } else {
+      const char s = 'R';
+      double len = ub - lb;
+      CPXnewrows(cplexEnv(), _prob, 1, &lb, &s, &len, 0);
+    }
+
     std::vector<int> indices;
+    std::vector<int> rowlist;
     std::vector<Value> values;
 
@@ -125,26 +138,10 @@
       indices.push_back(it->first);
       values.push_back(it->second);
-    }
-
-    if (lb == -INF) {
-      const char s = 'L';
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-    } else if (ub == INF) {
-      const char s = 'G';
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-    } else if (lb == ub){
-      const char s = 'E';
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &lb, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-    } else {
-      const char s = 'R';
-      double len = ub - lb;
-      CPXaddrows(cplexEnv(), _prob, 0, 1, values.size(), &ub, &s,
-                 &rmatbeg, &indices.front(), &values.front(), 0, 0);
-      CPXchgrngval(cplexEnv(), _prob, 1, &i, &len);
-    }
-    
+      rowlist.push_back(i);
+    }
+
+    CPXchgcoeflist(cplexEnv(), _prob, values.size(),
+                   &rowlist.front(), &indices.front(), &values.front());
+
     return i;
   }
Index: lemon/cycle_canceling.h
===================================================================
--- lemon/cycle_canceling.h	(revision 1298)
+++ lemon/cycle_canceling.h	(revision 1270)
@@ -196,5 +196,5 @@
 
     // Parameters of the problem
-    bool _has_lower;
+    bool _have_lower;
     Value _sum_supply;
 
@@ -279,7 +279,8 @@
     template <typename LowerMap>
     CycleCanceling& lowerMap(const LowerMap& map) {
-      _has_lower = true;
+      _have_lower = true;
       for (ArcIt a(_graph); a != INVALID; ++a) {
         _lower[_arc_idf[a]] = map[a];
+        _lower[_arc_idb[a]] = map[a];
       }
       return *this;
@@ -471,5 +472,5 @@
         _cost[_reverse[j]] = 0;
       }
-      _has_lower = false;
+      _have_lower = false;
       return *this;
     }
@@ -684,5 +685,5 @@
       const Value MAX = std::numeric_limits<Value>::max();
       int last_out;
-      if (_has_lower) {
+      if (_have_lower) {
         for (int i = 0; i != _root; ++i) {
           last_out = _first_out[i+1];
@@ -727,5 +728,5 @@
         sup[n] = _supply[_node_id[n]];
       }
-      if (_has_lower) {
+      if (_have_lower) {
         for (ArcIt a(_graph); a != INVALID; ++a) {
           int j = _arc_idf[a];
@@ -784,9 +785,9 @@
     }
 
-    // Check if the upper bound is greater than or equal to the lower bound
-    // on each forward arc.
+    // Check if the upper bound is greater or equal to the lower bound
+    // on each arc.
     bool checkBoundMaps() {
       for (int j = 0; j != _res_arc_num; ++j) {
-        if (_forward[j] && _upper[j] < _lower[j]) return false;
+        if (_upper[j] < _lower[j]) return false;
       }
       return true;
@@ -835,8 +836,8 @@
 
       // Handle non-zero lower bounds
-      if (_has_lower) {
+      if (_have_lower) {
         int limit = _first_out[_root];
         for (int j = 0; j != limit; ++j) {
-          if (_forward[j]) _res_cap[_reverse[j]] += _lower[j];
+          if (!_forward[j]) _res_cap[j] += _lower[j];
         }
       }
Index: lemon/dim2.h
===================================================================
--- lemon/dim2.h	(revision 1311)
+++ lemon/dim2.h	(revision 761)
@@ -21,5 +21,4 @@
 
 #include <iostream>
-#include <algorithm>
 
 ///\ingroup geomdat
Index: lemon/elevator.h
===================================================================
--- lemon/elevator.h	(revision 1328)
+++ lemon/elevator.h	(revision 628)
@@ -168,5 +168,5 @@
     int onLevel(int l) const
     {
-      return static_cast<int>(_first[l+1]-_first[l]);
+      return _first[l+1]-_first[l];
     }
     ///Return true if level \c l is empty.
@@ -178,10 +178,10 @@
     int aboveLevel(int l) const
     {
-      return static_cast<int>(_first[_max_level+1]-_first[l+1]);
+      return _first[_max_level+1]-_first[l+1];
     }
     ///Return the number of active items on level \c l.
     int activesOnLevel(int l) const
     {
-      return static_cast<int>(_last_active[l]-_first[l]+1);
+      return _last_active[l]-_first[l]+1;
     }
     ///Return true if there is no active item on level \c l.
Index: lemon/lp.h
===================================================================
--- lemon/lp.h	(revision 1323)
+++ lemon/lp.h	(revision 1270)
@@ -23,18 +23,12 @@
 
 
-#if LEMON_DEFAULT_LP == _LEMON_GLPK || LEMON_DEFAULT_MIP == _LEMON_GLPK
+#ifdef LEMON_HAVE_GLPK
 #include <lemon/glpk.h>
-#endif
-#if LEMON_DEFAULT_LP == _LEMON_CPLEX || LEMON_DEFAULT_MIP == _LEMON_CPLEX 
+#elif LEMON_HAVE_CPLEX
 #include <lemon/cplex.h>
-#endif
-#if LEMON_DEFAULT_LP == _LEMON_SOPLEX
+#elif LEMON_HAVE_SOPLEX
 #include <lemon/soplex.h>
-#endif
-#if LEMON_DEFAULT_LP == _LEMON_CLP
+#elif LEMON_HAVE_CLP
 #include <lemon/clp.h>
-#endif
-#if LEMON_DEFAULT_MIP == _LEMON_CBC
-#include <lemon/cbc.h>
 #endif
 
@@ -50,6 +44,6 @@
   ///\ingroup lp_group
   ///
-  ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX,
-  ///\c _LEMON_SOPLEX or \c LEMON__CLP
+  ///Currently, the possible values are \c GLPK, \c CPLEX,
+  ///\c SOPLEX or \c CLP
 #define LEMON_DEFAULT_LP SOLVER
   ///The default LP solver
@@ -66,6 +60,5 @@
   ///\ingroup lp_group
   ///
-  ///Currently, the possible values are \c _LEMON_GLPK, \c LEMON__CPLEX
-  ///or \c _LEMON_CBC
+  ///Currently, the possible values are \c GLPK, \c CPLEX or \c CBC
 #define LEMON_DEFAULT_MIP SOLVER
   ///The default MIP solver.
@@ -77,18 +70,18 @@
   typedef GlpkMip Mip;
 #else
-#if LEMON_DEFAULT_LP == _LEMON_GLPK
+#if LEMON_DEFAULT_LP == GLPK
   typedef GlpkLp Lp;
-#elif LEMON_DEFAULT_LP == _LEMON_CPLEX
+#elif LEMON_DEFAULT_LP == CPLEX
   typedef CplexLp Lp;
-#elif LEMON_DEFAULT_LP == _LEMON_SOPLEX
+#elif LEMON_DEFAULT_LP == SOPLEX
   typedef SoplexLp Lp;
-#elif LEMON_DEFAULT_LP == _LEMON_CLP
+#elif LEMON_DEFAULT_LP == CLP
   typedef ClpLp Lp;
 #endif
-#if LEMON_DEFAULT_MIP == _LEMON_GLPK
-  typedef GlpkMip Mip;
-#elif LEMON_DEFAULT_MIP == _LEMON_CPLEX
+#if LEMON_DEFAULT_MIP == GLPK
+  typedef GlpkLp Mip;
+#elif LEMON_DEFAULT_MIP == CPLEX
   typedef CplexMip Mip;
-#elif LEMON_DEFAULT_MIP == _LEMON_CBC
+#elif LEMON_DEFAULT_MIP == CBC
   typedef CbcMip Mip;
 #endif
Index: lemon/math.h
===================================================================
--- lemon/math.h	(revision 1311)
+++ lemon/math.h	(revision 1270)
@@ -68,5 +68,5 @@
   ///Round a value to its closest integer
   inline double round(double r) {
-    return (r > 0.0) ? std::floor(r + 0.5) : std::ceil(r - 0.5);
+    return (r > 0.0) ? floor(r + 0.5) : ceil(r - 0.5);
   }
 
Index: lemon/network_simplex.h
===================================================================
--- lemon/network_simplex.h	(revision 1318)
+++ lemon/network_simplex.h	(revision 1270)
@@ -199,5 +199,5 @@
 
     // Parameters of the problem
-    bool _has_lower;
+    bool _have_lower;
     SupplyType _stype;
     Value _sum_supply;
@@ -683,5 +683,5 @@
     template <typename LowerMap>
     NetworkSimplex& lowerMap(const LowerMap& map) {
-      _has_lower = true;
+      _have_lower = true;
       for (ArcIt a(_graph); a != INVALID; ++a) {
         _lower[_arc_id[a]] = map[a];
@@ -880,5 +880,5 @@
         _cost[i] = 1;
       }
-      _has_lower = false;
+      _have_lower = false;
       _stype = GEQ;
       return *this;
@@ -937,5 +937,5 @@
         _node_id[n] = i;
       }
-      if (_arc_mixing && _node_num > 1) {
+      if (_arc_mixing) {
         // Store the arcs in a mixed order
         const int skip = std::max(_arc_num / _node_num, 3);
@@ -1073,5 +1073,5 @@
 
       // Remove non-zero lower bounds
-      if (_has_lower) {
+      if (_have_lower) {
         for (int i = 0; i != _arc_num; ++i) {
           Value c = _lower[i];
@@ -1236,5 +1236,5 @@
     }
 
-    // Check if the upper bound is greater than or equal to the lower bound
+    // Check if the upper bound is greater or equal to the lower bound
     // on each arc.
     bool checkBoundMaps() {
@@ -1613,5 +1613,5 @@
 
       // Transform the solution and the supply map to the original form
-      if (_has_lower) {
+      if (_have_lower) {
         for (int i = 0; i != _arc_num; ++i) {
           Value c = _lower[i];
Index: lemon/radix_sort.h
===================================================================
--- lemon/radix_sort.h	(revision 1328)
+++ lemon/radix_sort.h	(revision 1270)
@@ -329,5 +329,5 @@
       Allocator allocator;
 
-      int length = static_cast<int>(std::distance(first, last));
+      int length = std::distance(first, last);
       Key* buffer = allocator.allocate(2 * length);
       try {
Index: lemon/random.h
===================================================================
--- lemon/random.h	(revision 1328)
+++ lemon/random.h	(revision 631)
@@ -200,5 +200,5 @@
         initState(init);
 
-        num = static_cast<int>(length > end - begin ? length : end - begin);
+        num = length > end - begin ? length : end - begin;
         while (num--) {
           curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul1))
@@ -214,5 +214,5 @@
         }
 
-        num = length - 1; cnt = static_cast<int>(length - (curr - state) - 1);
+        num = length - 1; cnt = length - (curr - state) - 1;
         while (num--) {
           curr[0] = (curr[0] ^ ((curr[1] ^ (curr[1] >> (bits - 2))) * mul2))
Index: lemon/static_graph.h
===================================================================
--- lemon/static_graph.h	(revision 1328)
+++ lemon/static_graph.h	(revision 956)
@@ -204,5 +204,5 @@
 
       node_num = n;
-      arc_num = static_cast<int>(std::distance(first, last));
+      arc_num = std::distance(first, last);
 
       node_first_out = new int[node_num + 1];
Index: test/arc_look_up_test.cc
===================================================================
--- test/arc_look_up_test.cc	(revision 1312)
+++ test/arc_look_up_test.cc	(revision 1270)
@@ -25,4 +25,5 @@
 using namespace lemon;
 
+const int lgfn = 4;
 const std::string lgf =
   "@nodes\n"
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 1300)
+++ test/lp_test.cc	(revision 1270)
@@ -40,7 +40,4 @@
 #endif
 
-#ifdef LEMON_HAVE_LP
-#include <lemon/lp.h>
-#endif
 using namespace lemon;
 
@@ -420,13 +417,4 @@
   lpTest(lp_skel);
 
-#ifdef LEMON_HAVE_LP
-  {
-    Lp lp,lp2;
-    lpTest(lp);
-    aTest(lp2);
-    cloneTest<Lp>();
-  }
-#endif
-
 #ifdef LEMON_HAVE_GLPK
   {
Index: test/min_cost_flow_test.cc
===================================================================
--- test/min_cost_flow_test.cc	(revision 1318)
+++ test/min_cost_flow_test.cc	(revision 1270)
@@ -396,10 +396,4 @@
   checkMcf(mcf3, mcf3.run(param), neg2_gr, neg2_l, neg2_u, neg2_c, neg2_s,
            mcf3.OPTIMAL, true,     -300, test_str + "-18", GEQ);
-
-  // Tests for empty graph
-  Digraph gr0;
-  MCF mcf0(gr0);
-  mcf0.run(param);
-  check(mcf0.totalCost() == 0, "Wrong total cost");  
 }
 
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 1300)
+++ test/mip_test.cc	(revision 795)
@@ -31,8 +31,4 @@
 #ifdef LEMON_HAVE_CBC
 #include <lemon/cbc.h>
-#endif
-
-#ifdef LEMON_HAVE_MIP
-#include <lemon/lp.h>
 #endif
 
@@ -133,12 +129,4 @@
 {
 
-#ifdef LEMON_HAVE_MIP
-  {
-    Mip mip1;
-    aTest(mip1);
-    cloneTest<Mip>();
-  }
-#endif
-
 #ifdef LEMON_HAVE_GLPK
   {
Index: test/tsp_test.cc
===================================================================
--- test/tsp_test.cc	(revision 1303)
+++ test/tsp_test.cc	(revision 1271)
@@ -133,6 +133,5 @@
     int esize = n <= 1 ? 0 : n;
 
-    ConstMap<Edge, int> cost_map(1);
-    TSP alg(g, cost_map);
+    TSP alg(g, constMap<Edge, int>(1));
 
     check(alg.run() == esize, alg_name + ": Wrong total cost");
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 {
