Index: lemon/clp.cc
===================================================================
--- lemon/clp.cc	(revision 485)
+++ lemon/clp.cc	(revision 587)
@@ -57,10 +57,10 @@
   }
 
-  ClpLp* ClpLp::_newSolver() const {
+  ClpLp* ClpLp::newSolver() const {
     ClpLp* newlp = new ClpLp;
     return newlp;
   }
 
-  ClpLp* ClpLp::_cloneSolver() const {
+  ClpLp* ClpLp::cloneSolver() const {
     ClpLp* copylp = new ClpLp(*this);
     return copylp;
Index: lemon/clp.h
===================================================================
--- lemon/clp.h	(revision 485)
+++ lemon/clp.h	(revision 587)
@@ -57,4 +57,9 @@
     ~ClpLp();
 
+    /// \e
+    virtual ClpLp* newSolver() const;
+    /// \e
+    virtual ClpLp* cloneSolver() const;
+
   protected:
 
@@ -66,7 +71,4 @@
 
   protected:
-
-    virtual ClpLp* _newSolver() const;
-    virtual ClpLp* _cloneSolver() const;
 
     virtual const char* _solverName() const;
Index: lemon/cplex.cc
===================================================================
--- lemon/cplex.cc	(revision 485)
+++ lemon/cplex.cc	(revision 587)
@@ -452,6 +452,6 @@
   CplexLp::~CplexLp() {}
 
-  CplexLp* CplexLp::_newSolver() const { return new CplexLp; }
-  CplexLp* CplexLp::_cloneSolver() const {return new CplexLp(*this); }
+  CplexLp* CplexLp::newSolver() const { return new CplexLp; }
+  CplexLp* CplexLp::cloneSolver() const {return new CplexLp(*this); }
 
   const char* CplexLp::_solverName() const { return "CplexLp"; }
@@ -824,6 +824,6 @@
   CplexMip::~CplexMip() {}
 
-  CplexMip* CplexMip::_newSolver() const { return new CplexMip; }
-  CplexMip* CplexMip::_cloneSolver() const {return new CplexMip(*this); }
+  CplexMip* CplexMip::newSolver() const { return new CplexMip; }
+  CplexMip* CplexMip::cloneSolver() const {return new CplexMip(*this); }
 
   const char* CplexMip::_solverName() const { return "CplexMip"; }
Index: lemon/cplex.h
===================================================================
--- lemon/cplex.h	(revision 485)
+++ lemon/cplex.h	(revision 587)
@@ -161,5 +161,5 @@
   /// This class implements an interface for the CPLEX LP solver.
   ///\ingroup lp_group
-  class CplexLp : public CplexBase, public LpSolver {
+  class CplexLp : public LpSolver, public CplexBase {
   public:
     /// \e
@@ -171,4 +171,9 @@
     /// \e
     virtual ~CplexLp();
+
+    /// \e
+    virtual CplexLp* cloneSolver() const;
+    /// \e
+    virtual CplexLp* newSolver() const;
 
   private:
@@ -186,7 +191,4 @@
 
   protected:
-
-    virtual CplexLp* _cloneSolver() const;
-    virtual CplexLp* _newSolver() const;
 
     virtual const char* _solverName() const;
@@ -223,5 +225,5 @@
   /// This class implements an interface for the CPLEX MIP solver.
   ///\ingroup lp_group
-  class CplexMip : public CplexBase, public MipSolver {
+  class CplexMip : public MipSolver, public CplexBase {
   public:
     /// \e
Index: lemon/glpk.cc
===================================================================
--- lemon/glpk.cc	(revision 485)
+++ lemon/glpk.cc	(revision 589)
@@ -523,4 +523,10 @@
   }
 
+  void GlpkBase::freeEnv() {
+    glp_free_env();
+  }
+
+  GlpkBase::FreeEnvHelper GlpkBase::freeEnvHelper;
+
   // GlpkLp members
 
@@ -535,6 +541,6 @@
   }
 
-  GlpkLp* GlpkLp::_newSolver() const { return new GlpkLp; }
-  GlpkLp* GlpkLp::_cloneSolver() const { return new GlpkLp(*this); }
+  GlpkLp* GlpkLp::newSolver() const { return new GlpkLp; }
+  GlpkLp* GlpkLp::cloneSolver() const { return new GlpkLp(*this); }
 
   const char* GlpkLp::_solverName() const { return "GlpkLp"; }
@@ -941,6 +947,6 @@
   }
 
-  GlpkMip* GlpkMip::_newSolver() const { return new GlpkMip; }
-  GlpkMip* GlpkMip::_cloneSolver() const {return new GlpkMip(*this); }
+  GlpkMip* GlpkMip::newSolver() const { return new GlpkMip; }
+  GlpkMip* GlpkMip::cloneSolver() const {return new GlpkMip(*this); }
 
   const char* GlpkMip::_solverName() const { return "GlpkMip"; }
Index: lemon/glpk.h
===================================================================
--- lemon/glpk.h	(revision 485)
+++ lemon/glpk.h	(revision 589)
@@ -101,4 +101,16 @@
     virtual void _clear();
 
+  private:
+
+    static void freeEnv();
+
+    struct FreeEnvHelper {
+      ~FreeEnvHelper() {
+        freeEnv();
+      }
+    };
+    
+    static FreeEnvHelper freeEnvHelper;
+    
   public:
 
@@ -120,5 +132,5 @@
   /// This class implements an interface for the GLPK LP solver.
   ///\ingroup lp_group
-  class GlpkLp : public GlpkBase, public LpSolver {
+  class GlpkLp : public LpSolver, public GlpkBase {
   public:
 
@@ -127,4 +139,9 @@
     ///\e
     GlpkLp(const GlpkLp&);
+
+    ///\e
+    virtual GlpkLp* cloneSolver() const;
+    ///\e
+    virtual GlpkLp* newSolver() const;
 
   private:
@@ -136,7 +153,4 @@
 
   protected:
-
-    virtual GlpkLp* _cloneSolver() const;
-    virtual GlpkLp* _newSolver() const;
 
     virtual const char* _solverName() const;
@@ -154,6 +168,4 @@
     virtual Value _getDualRay(int i) const;
 
-    ///\todo It should be clarified
-    ///
     virtual ProblemType _getPrimalType() const;
     virtual ProblemType _getDualType() const;
@@ -204,5 +216,5 @@
   /// This class implements an interface for the GLPK MIP solver.
   ///\ingroup lp_group
-  class GlpkMip : public GlpkBase, public MipSolver {
+  class GlpkMip : public MipSolver, public GlpkBase {
   public:
 
@@ -212,8 +224,8 @@
     GlpkMip(const GlpkMip&);
 
-  protected:
-
-    virtual GlpkMip* _cloneSolver() const;
-    virtual GlpkMip* _newSolver() const;
+    virtual GlpkMip* cloneSolver() const;
+    virtual GlpkMip* newSolver() const;
+
+  protected:
 
     virtual const char* _solverName() const;
Index: lemon/lp_base.h
===================================================================
--- lemon/lp_base.h	(revision 561)
+++ lemon/lp_base.h	(revision 587)
@@ -919,6 +919,4 @@
 
     //Abstract virtual functions
-    virtual LpBase* _newSolver() const = 0;
-    virtual LpBase* _cloneSolver() const = 0;
 
     virtual int _addColId(int col) { return cols.addIndex(col); }
@@ -987,9 +985,4 @@
     /// Virtual destructor
     virtual ~LpBase() {}
-
-    ///Creates a new LP problem
-    LpBase* newSolver() {return _newSolver();}
-    ///Makes a copy of the LP problem
-    LpBase* cloneSolver() {return _cloneSolver();}
 
     ///Gives back the name of the solver.
@@ -1822,4 +1815,9 @@
   public:
 
+    ///Allocate a new LP problem instance
+    virtual LpSolver* newSolver() const = 0;
+    ///Make a copy of the LP problem
+    virtual LpSolver* cloneSolver() const = 0;
+
     ///\name Solve the LP
 
@@ -1936,11 +1934,6 @@
     ///@}
 
-    LpSolver* newSolver() {return _newSolver();}
-    LpSolver* cloneSolver() {return _cloneSolver();}
-
   protected:
 
-    virtual LpSolver* _newSolver() const = 0;
-    virtual LpSolver* _cloneSolver() const = 0;
   };
 
@@ -1976,4 +1969,9 @@
     };
 
+    ///Allocate a new MIP problem instance
+    virtual MipSolver* newSolver() const = 0;
+    ///Make a copy of the MIP problem
+    virtual MipSolver* cloneSolver() const = 0;
+
     ///\name Solve the MIP
 
@@ -2063,13 +2061,4 @@
     virtual Value _getSolValue() const = 0;
 
-  public:
-
-    MipSolver* newSolver() {return _newSolver();}
-    MipSolver* cloneSolver() {return _cloneSolver();}
-
-  protected:
-
-    virtual MipSolver* _newSolver() const = 0;
-    virtual MipSolver* _cloneSolver() const = 0;
   };
 
Index: lemon/lp_skeleton.cc
===================================================================
--- lemon/lp_skeleton.cc	(revision 482)
+++ lemon/lp_skeleton.cc	(revision 587)
@@ -106,8 +106,8 @@
   { return BASIC; }
 
-  LpSkeleton* LpSkeleton::_newSolver() const
+  LpSkeleton* LpSkeleton::newSolver() const
   { return static_cast<LpSkeleton*>(0); }
 
-  LpSkeleton* LpSkeleton::_cloneSolver() const
+  LpSkeleton* LpSkeleton::cloneSolver() const
   { return static_cast<LpSkeleton*>(0); }
 
@@ -123,8 +123,8 @@
   { return UNDEFINED; }
 
-  MipSkeleton* MipSkeleton::_newSolver() const
+  MipSkeleton* MipSkeleton::newSolver() const
   { return static_cast<MipSkeleton*>(0); }
 
-  MipSkeleton* MipSkeleton::_cloneSolver() const
+  MipSkeleton* MipSkeleton::cloneSolver() const
   { return static_cast<MipSkeleton*>(0); }
 
Index: lemon/lp_skeleton.h
===================================================================
--- lemon/lp_skeleton.h	(revision 576)
+++ lemon/lp_skeleton.h	(revision 588)
@@ -23,8 +23,14 @@
 
 ///\file
-///\brief A skeleton file to implement LP solver interfaces
+///\brief Skeleton file to implement LP/MIP solver interfaces
+///  
+///The classes in this file do nothing, but they can serve as skeletons when
+///implementing an interface to new solvers.
 namespace lemon {
 
-  ///A skeleton class to implement LP solver interfaces
+  ///A skeleton class to implement LP/MIP solver base interface
+  
+  ///This class does nothing, but it can serve as a skeleton when
+  ///implementing an interface to new solvers.
   class SkeletonSolverBase : public virtual LpBase {
     int col_num,row_num;
@@ -137,12 +143,18 @@
   };
 
-  /// \brief Interface for a skeleton LP solver
+  /// \brief Skeleton class for an LP solver interface
   ///
-  /// This class implements an interface for a skeleton LP solver.
+  ///This class does nothing, but it can serve as a skeleton when
+  ///implementing an interface to new solvers.
+
   ///\ingroup lp_group
-  class LpSkeleton : public SkeletonSolverBase, public LpSolver {
+  class LpSkeleton : public LpSolver, public SkeletonSolverBase {
   public:
-    LpSkeleton() : SkeletonSolverBase(), LpSolver() {}
-
+    ///\e
+    LpSkeleton() : LpSolver(), SkeletonSolverBase() {}
+    ///\e
+    virtual LpSkeleton* newSolver() const;
+    ///\e
+    virtual LpSkeleton* cloneSolver() const;
   protected:
 
@@ -174,53 +186,37 @@
 
     ///\e
-    virtual LpSkeleton* _newSolver() const;
-    ///\e
-    virtual LpSkeleton* _cloneSolver() const;
-    ///\e
     virtual const char* _solverName() const;
 
   };
 
-  /// \brief Interface for a skeleton MIP solver
+  /// \brief Skeleton class for a MIP solver interface
   ///
-  /// This class implements an interface for a skeleton MIP solver.
+  ///This class does nothing, but it can serve as a skeleton when
+  ///implementing an interface to new solvers.
   ///\ingroup lp_group
-  class MipSkeleton : public SkeletonSolverBase, public MipSolver {
+  class MipSkeleton : public MipSolver, public SkeletonSolverBase {
   public:
-    MipSkeleton() : SkeletonSolverBase(), MipSolver() {}
+    ///\e
+    MipSkeleton() : MipSolver(), SkeletonSolverBase() {}
+    ///\e
+    virtual MipSkeleton* newSolver() const;
+    ///\e
+    virtual MipSkeleton* cloneSolver() const;
 
   protected:
     ///\e
-
-    ///\bug Wrong interface
-    ///
     virtual SolveExitStatus _solve();
 
     ///\e
-
-    ///\bug Wrong interface
-    ///
     virtual Value _getSol(int i) const;
 
     ///\e
-
-    ///\bug Wrong interface
-    ///
     virtual Value _getSolValue() const;
 
     ///\e
-
-    ///\bug Wrong interface
-    ///
     virtual ProblemType _getType() const;
 
     ///\e
-    virtual MipSkeleton* _newSolver() const;
-
-    ///\e
-    virtual MipSkeleton* _cloneSolver() const;
-    ///\e
     virtual const char* _solverName() const;
-
   };
 
Index: lemon/soplex.cc
===================================================================
--- lemon/soplex.cc	(revision 485)
+++ lemon/soplex.cc	(revision 587)
@@ -20,5 +20,5 @@
 #include <lemon/soplex.h>
 
-#include <soplex/soplex.h>
+#include <soplex.h>
 
 
@@ -55,10 +55,10 @@
   }
 
-  SoplexLp* SoplexLp::_newSolver() const {
+  SoplexLp* SoplexLp::newSolver() const {
     SoplexLp* newlp = new SoplexLp();
     return newlp;
   }
 
-  SoplexLp* SoplexLp::_cloneSolver() const {
+  SoplexLp* SoplexLp::cloneSolver() const {
     SoplexLp* newlp = new SoplexLp(*this);
     return newlp;
Index: lemon/soplex.h
===================================================================
--- lemon/soplex.h	(revision 485)
+++ lemon/soplex.h	(revision 587)
@@ -74,9 +74,10 @@
     /// \e
     ~SoplexLp();
+    /// \e
+    virtual SoplexLp* newSolver() const;
+    /// \e
+    virtual SoplexLp* cloneSolver() const;
 
   protected:
-
-    virtual SoplexLp* _newSolver() const;
-    virtual SoplexLp* _cloneSolver() const;
 
     virtual const char* _solverName() const;
Index: m4/lx_check_soplex.m4
===================================================================
--- m4/lx_check_soplex.m4	(revision 480)
+++ m4/lx_check_soplex.m4	(revision 586)
@@ -21,5 +21,5 @@
       SOPLEX_CXXFLAGS="-I$with_soplex_includedir"
     elif test x"$with_soplex" != x"yes"; then
-      SOPLEX_CXXFLAGS="-I$with_soplex/include"
+      SOPLEX_CXXFLAGS="-I$with_soplex/src"
     fi
 
@@ -39,5 +39,5 @@
 
     lx_soplex_test_prog='
-      #include <soplex/soplex.h>
+      #include <soplex.h>
 
       int main(int argc, char** argv)
Index: test/lp_test.cc
===================================================================
--- test/lp_test.cc	(revision 485)
+++ test/lp_test.cc	(revision 589)
@@ -198,4 +198,9 @@
     check(const_cast<const LpSolver::Expr&>(e)[p2]==0, buf.str());
 
+    //Test for clone/new
+    LP* lpnew = lp.newSolver();
+    LP* lpclone = lp.cloneSolver();
+    delete lpnew;
+    delete lpclone;
 
   }
@@ -248,5 +253,6 @@
   if (stat ==  LpSolver::OPTIMAL) {
     std::ostringstream sbuf;
-    sbuf << "Wrong optimal value: the right optimum is " << exp_opt;
+    sbuf << "Wrong optimal value (" << lp.primal() <<") with "
+         << lp.solverName() <<"\n     the right optimum is " << exp_opt;
     check(std::abs(lp.primal()-exp_opt) < 1e-3, sbuf.str());
   }
@@ -356,4 +362,17 @@
 }
 
+template<class LP>
+void cloneTest()
+{
+  //Test for clone/new
+  
+  LP* lp = new LP();
+  LP* lpnew = lp->newSolver();
+  LP* lpclone = lp->cloneSolver();
+  delete lp;
+  delete lpnew;
+  delete lpclone;
+}
+
 int main()
 {
@@ -366,4 +385,5 @@
     lpTest(lp_glpk1);
     aTest(lp_glpk2);
+    cloneTest<GlpkLp>();
   }
 #endif
@@ -382,4 +402,5 @@
 #endif
   }
+    cloneTest<CplexLp>();
 #endif
 
@@ -389,4 +410,5 @@
     lpTest(lp_soplex1);
     aTest(lp_soplex2);
+    cloneTest<SoplexLp>();
   }
 #endif
@@ -397,4 +419,5 @@
     lpTest(lp_clp1);
     aTest(lp_clp2);
+    cloneTest<ClpLp>();
   }
 #endif
Index: test/mip_test.cc
===================================================================
--- test/mip_test.cc	(revision 485)
+++ test/mip_test.cc	(revision 589)
@@ -107,4 +107,15 @@
 }
 
+template<class MIP>
+void cloneTest()
+{
+  
+  MIP* mip = new MIP();
+  MIP* mipnew = mip->newSolver();
+  MIP* mipclone = mip->cloneSolver();
+  delete mip;
+  delete mipnew;
+  delete mipclone;
+}
 
 int main()
@@ -115,4 +126,5 @@
     GlpkMip mip1;
     aTest(mip1);
+    cloneTest<GlpkMip>();
   }
 #endif
@@ -130,4 +142,5 @@
 #endif
   }
+  cloneTest<CplexMip>();
 #endif
 
