diff --git a/AMDiS/src/AdaptInfo.h b/AMDiS/src/AdaptInfo.h
index 8357f513dcff1fb6a9778743d7be1776a6ff2932..50e88f7a4a75637b70769865828e699d207155a8 100644
--- a/AMDiS/src/AdaptInfo.h
+++ b/AMDiS/src/AdaptInfo.h
@@ -617,13 +617,13 @@ namespace AMDiS {
     }
 
     /// Returns \ref refineBisections
-    inline const int getRefineBisections(int index) const 
+    inline int getRefineBisections(int index) const 
     {
       return scalContents[index]->refineBisections;
     }
 
     /// Returns \ref coarseBisections
-    inline const int getCoarseBisections(int index) const 
+    inline int getCoarseBisections(int index) const 
     {
       return scalContents[index]->coarseBisections;
     }    
@@ -679,7 +679,7 @@ namespace AMDiS {
     }
 
     /// Returns true, if the adaptive procedure was deserialized from a file.
-    const bool isDeserialized() const 
+    bool isDeserialized() const 
     {
       return deserialized;
     }
diff --git a/AMDiS/src/AdaptInstationary.h b/AMDiS/src/AdaptInstationary.h
index d9146a7e61515a3d45a85049941334d2e20979bf..878c5a4ea967efa51b2685decf1d307c09af4b3b 100644
--- a/AMDiS/src/AdaptInstationary.h
+++ b/AMDiS/src/AdaptInstationary.h
@@ -83,7 +83,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref strategy
-    const int getStrategy() const 
+    int getStrategy() const 
     {
       return strategy;
     }
diff --git a/AMDiS/src/BasisFunction.h b/AMDiS/src/BasisFunction.h
index 553fd8960d64fd3d4dd62aa8b28e09f3a060f6ac..7c1bc3845dbaa7ec0d0bdfde724de46372cc3ecb 100644
--- a/AMDiS/src/BasisFunction.h
+++ b/AMDiS/src/BasisFunction.h
@@ -125,19 +125,19 @@ namespace AMDiS {
     virtual void getBound(const ElInfo*, BoundaryType *) const {}
 
     /// Returns \ref degree of BasisFunction
-    inline const int getDegree() const 
+    inline int getDegree() const 
     { 
       return degree; 
     }
 
     /// Returns \ref dim of BasisFunction
-    inline const int getDim() const 
+    inline int getDim() const 
     { 
       return dim; 
     }
 
     /// Returns \ref nBasFcts which is the number of local basis functions
-    inline const int getNumber() const 
+    inline int getNumber() const 
     { 
       return nBasFcts; 
     }
diff --git a/AMDiS/src/DOFAdmin.h b/AMDiS/src/DOFAdmin.h
index f57dac7d0af36a736c07f10de02db13140187390..1dbdb96032e31a9ff8bf47e6ef22ccc9836ad16a 100644
--- a/AMDiS/src/DOFAdmin.h
+++ b/AMDiS/src/DOFAdmin.h
@@ -121,25 +121,25 @@ namespace AMDiS {
      */
 
     /// Returns \ref sizeUsed.
-    inline const int getUsedSize() const 
+    inline int getUsedSize() const 
     { 
       return sizeUsed; 
     }
 
     /// Returns \ref size
-    inline const int getSize() const
+    inline int getSize() const
     { 
       return size; 
     }
 
     /// Returns \ref usedCount
-    inline const int getUsedDofs() const 
+    inline int getUsedDofs() const 
     { 
       return usedCount; 
     }
 
     /// Returns \ref holeCount
-    inline const int getHoleCount() const 
+    inline int getHoleCount() const 
     { 
       return holeCount; 
     }
@@ -151,7 +151,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref nDof[i], i.e., the number of DOFs for the position i.
-    inline const int getNumberOfDofs(int i) const 
+    inline int getNumberOfDofs(int i) const 
     {
       return nDof[i];
     }
@@ -163,7 +163,7 @@ namespace AMDiS {
     }
  
     /// Returns \ref nPreDof[i]
-    inline const int getNumberOfPreDofs(int i) const 
+    inline int getNumberOfPreDofs(int i) const 
     {
       return nPreDof[i];
     }
@@ -187,7 +187,7 @@ namespace AMDiS {
     }
 
     /// Returns if the given DOF is free.
-    inline const bool isDofFree(int i) const 
+    inline bool isDofFree(int i) const 
     {
       return dofFree[i];
     }
diff --git a/AMDiS/src/DOFVector.h b/AMDiS/src/DOFVector.h
index d18da64122b39c335211fd2ed99bb383a1b402d1..a141c5c8695b16ae747128a278116f9fe9864564 100644
--- a/AMDiS/src/DOFVector.h
+++ b/AMDiS/src/DOFVector.h
@@ -154,33 +154,33 @@ namespace AMDiS {
       operatorEstFactor.push_back(estFactor);
     }
 
-    inline vector<double*>::iterator getOperatorFactorBegin() 
+    inline std::vector<double*>::iterator getOperatorFactorBegin() 
     {
       return operatorFactor.begin();
     }
 
-    inline vector<double*>::iterator getOperatorFactorEnd() 
+    inline std::vector<double*>::iterator getOperatorFactorEnd() 
     {
       return operatorFactor.end();
     }
 
-    inline vector<double*>::iterator getOperatorEstFactorBegin() 
+    inline std::vector<double*>::iterator getOperatorEstFactorBegin() 
     {
       return operatorEstFactor.begin();
     }
 
-    inline vector<double*>::iterator getOperatorEstFactorEnd() 
+    inline std::vector<double*>::iterator getOperatorEstFactorEnd() 
     {
       return operatorEstFactor.end();
     }
 
 
-    inline vector<Operator*>::iterator getOperatorsBegin() 
+    inline std::vector<Operator*>::iterator getOperatorsBegin() 
     {
       return operators.begin();
     }
 
-    inline vector<Operator*>::iterator getOperatorsEnd() 
+    inline std::vector<Operator*>::iterator getOperatorsEnd() 
     {
       return operators.end();
     }
@@ -193,17 +193,17 @@ namespace AMDiS {
     /// and \f$ m \f$ is the number of basis functions
     T evalUh(const DimVec<double>& lambda, DegreeOfFreedom* ind);
 
-    inline vector<Operator*>& getOperators() 
+    inline std::vector<Operator*>& getOperators() 
     { 
       return operators; 
     }
 
-    inline vector<double*>& getOperatorFactor() 
+    inline std::vector<double*>& getOperatorFactor() 
     { 
       return operatorFactor; 
     }
 
-    inline vector<double*>& getOperatorEstFactor() 
+    inline std::vector<double*>& getOperatorEstFactor() 
     { 
       return operatorEstFactor; 
     }
@@ -251,13 +251,13 @@ namespace AMDiS {
     ElementVector elementVector;
 
     ///
-    vector<Operator*> operators;
+    std::vector<Operator*> operators;
 
     ///
-    vector<double*> operatorFactor;
+    std::vector<double*> operatorFactor;
 
     ///
-    vector<double*> operatorEstFactor;
+    std::vector<double*> operatorEstFactor;
 
     ///
     BoundaryManager *boundaryManager;
@@ -345,7 +345,7 @@ namespace AMDiS {
     void init(const FiniteElemSpace* f, string n);
 
     /// Copy Constructor
-    DOFVector(const DOFVector& rhs) 
+    DOFVector(const DOFVector& rhs) : DOFVectorBase<T>()
     {
       *this = rhs;   
       this->name = rhs.name + "copy";
@@ -357,25 +357,25 @@ namespace AMDiS {
     virtual ~DOFVector();
 
     /// Returns iterator to the begin of \ref vec
-    typename vector<T>::iterator begin() 
+    typename std::vector<T>::iterator begin() 
     { 
       return vec.begin(); 
     }
 
     /// Returns iterator to the end of \ref vec
-    typename vector<T>::iterator end() 
+    typename std::vector<T>::iterator end() 
     { 
       return vec.end(); 
     }
 
     /// Returns const_iterator to the begin of \ref vec
-    typename vector<T>::const_iterator begin() const
+    typename std::vector<T>::const_iterator begin() const
     {
       return vec.begin();
     }
 
     /// Returns const_iterator to the end of \ref vec
-    typename vector<T>::const_iterator end() const
+    typename std::vector<T>::const_iterator end() const
     {
       return vec.end();
     }
@@ -383,7 +383,7 @@ namespace AMDiS {
     /// Used by DOFAdmin to compress this DOFVector. Implementation of
     /// \ref DOFIndexedBase::compress()
     virtual void compressDOFIndexed(int first, int last,
-				    vector<DegreeOfFreedom> &newDof);
+				    std::vector<DegreeOfFreedom> &newDof);
 
     /// Sets \ref coarsenOperation to op
     inline void setCoarsenOperation(CoarsenOperation op) 
@@ -404,7 +404,7 @@ namespace AMDiS {
     inline void refineInterpol(RCNeighbourList&, int) {}
 
     /// Returns \ref vec
-    vector<T>& getVector() 
+    std::vector<T>& getVector() 
     { 
       return vec;
     }
@@ -597,7 +597,7 @@ namespace AMDiS {
     /// Determine the DegreeOfFreedom that has coords with minimal euclidean 
     /// distance to WorldVector p. return true if DOF is found, and false 
     /// otherwise.
-    const bool getDofIdxAtPoint(WorldVector<double> &p, 
+    bool getDofIdxAtPoint(WorldVector<double> &p, 
 				DegreeOfFreedom &idx, 
 				ElInfo *oldElInfo = NULL, 
 				bool useOldElInfo = false) const;
@@ -630,7 +630,7 @@ namespace AMDiS {
   protected: 
 
     /// Data container
-    vector<T> vec; 
+    std::vector<T> vec; 
  
     /// Specifies what operation should be performed after coarsening
     CoarsenOperation coarsenOperation;
@@ -846,7 +846,7 @@ namespace AMDiS {
   }
 
   template<typename T>
-  inline void checkFeSpace(const FiniteElemSpace* feSpace, const vector<T>& vec)
+  inline void checkFeSpace(const FiniteElemSpace* feSpace, const std::vector<T>& vec)
   {
     TEST_EXIT_DBG(feSpace)("feSpace is NULL\n");
     TEST_EXIT_DBG(feSpace->getAdmin())("admin is NULL\n");
@@ -859,8 +859,8 @@ namespace AMDiS {
 					     WorldVector<DOFVector<double>*> *result);
   
   template<typename T>
-  vector<DOFVector<double>*> *transform(DOFVector<typename GradientType<T>::type> *vec,
-					     vector<DOFVector<double>*> *res);
+  std::vector<DOFVector<double>*> *transform(DOFVector<typename GradientType<T>::type> *vec,
+					     std::vector<DOFVector<double>*> *res);
 
   
   /// Computes the integral: \f$ \int f(\vec{x})\,\text{d}\vec{x}\f$
@@ -931,14 +931,14 @@ namespace AMDiS {
 			   BinaryAbstractFunction<TOut, T, WorldVector<double> > *fct);
   
   /// Computes the integral: \f$ \int f(\{v_i(\vec{x})\}_i)\,\text{d}\vec{x}\f$
-  double integrateGeneral(const vector<DOFVector<double>*> &vecs,
-			  AbstractFunction<double, vector<double> > *fct);
+  double integrateGeneral(const std::vector<DOFVector<double>*> &vecs,
+			  AbstractFunction<double, std::vector<double> > *fct);
   
   /// Computes the integral: 
   /// \f$ \int f(\{v_i(\vec{x})\}_i,\{\nabla w_i(\vec{x})\}_i)\,\text{d}\vec{x}\f$
-  double integrateGeneralGradient(const vector<DOFVector<double>*> &vecs,
-				  const vector<DOFVector<double>*> &grds,
-				  BinaryAbstractFunction<double, vector<double>, vector<WorldVector<double> > > *fct);
+  double integrateGeneralGradient(const std::vector<DOFVector<double>*> &vecs,
+				  const std::vector<DOFVector<double>*> &grds,
+				  BinaryAbstractFunction<double, std::vector<double>, std::vector<WorldVector<double> > > *fct);
 
 }
 
diff --git a/AMDiS/src/DOFVector.hh b/AMDiS/src/DOFVector.hh
index 59dab4b0c28eb790587796bb4149410571f9498d..fc96455013ea59c9bcb3cd2aa2a09e0549e1b23a 100644
--- a/AMDiS/src/DOFVector.hh
+++ b/AMDiS/src/DOFVector.hh
@@ -947,7 +947,7 @@ namespace AMDiS {
 
 
   template<typename T>
-  const bool DOFVector<T>::getDofIdxAtPoint(WorldVector<double> &p, 
+  bool DOFVector<T>::getDofIdxAtPoint(WorldVector<double> &p, 
 					    DegreeOfFreedom &idx, 
 					    ElInfo *oldElInfo, 
 					    bool useOldElInfo) const
diff --git a/AMDiS/src/ElInfo.h b/AMDiS/src/ElInfo.h
index 241e765ade7f2cd01b0016932c9ee346d098a9a5..776ddcdc3408787d357b023d3cbf39f8e8f46fb3 100644
--- a/AMDiS/src/ElInfo.h
+++ b/AMDiS/src/ElInfo.h
@@ -385,7 +385,7 @@ namespace AMDiS {
     /// with respect to \ref element of a point with world coordinates world.
     /// The barycentric coordinates are stored in lambda. 
     /// pure virtual => must be overriden in sub-class.
-    virtual const int worldToCoord(const WorldVector<double>& world, 
+    virtual int worldToCoord(const WorldVector<double>& world, 
 				   DimVec<double>* lambda) const = 0;
 
     /// Fills this ElInfo with macro element information of mel.
diff --git a/AMDiS/src/ElInfo1d.cc b/AMDiS/src/ElInfo1d.cc
index ffeb8388093b1ea1c9d4be2274ab9dfbc3cd5d65..385bd7cf064086bfd598e80f342df1c3fff44b89 100644
--- a/AMDiS/src/ElInfo1d.cc
+++ b/AMDiS/src/ElInfo1d.cc
@@ -143,7 +143,7 @@ namespace AMDiS {
     return sqrt(adet2);
   }
 
-  const int ElInfo1d::worldToCoord(const WorldVector<double>& x,
+  int ElInfo1d::worldToCoord(const WorldVector<double>& x,
 				   DimVec<double>* lambda) const
   {
     FUNCNAME("ElInfo1d::worldToCoord()");
diff --git a/AMDiS/src/ElInfo1d.h b/AMDiS/src/ElInfo1d.h
index dc2ba3e53ee2a664b874255d5cd9cde048f35e4e..bb79aec8329eb64977a2637fc0a080a50f1a8e0a 100644
--- a/AMDiS/src/ElInfo1d.h
+++ b/AMDiS/src/ElInfo1d.h
@@ -47,7 +47,7 @@ namespace AMDiS {
     void fillMacroInfo(const MacroElement*);
 
     /// 1-dimensional realisation of ElInfo's worldToCoord method.
-    const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;
+    int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;
 
     /// 1-dimensional realisation of ElInfo's calcGrdLambda method.
     double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
diff --git a/AMDiS/src/ElInfo2d.cc b/AMDiS/src/ElInfo2d.cc
index dea65894cf98ddfa00a57e264b4f47011ed4b514..1656a9c7ba4203772bf060577c6275cb517affd3 100644
--- a/AMDiS/src/ElInfo2d.cc
+++ b/AMDiS/src/ElInfo2d.cc
@@ -661,7 +661,7 @@ namespace AMDiS {
   }
 
 
-  const int ElInfo2d::worldToCoord(const WorldVector<double>& xy, 
+  int ElInfo2d::worldToCoord(const WorldVector<double>& xy, 
 				   DimVec<double>* lambda) const
   {
     FUNCNAME("ElInfo::worldToCoord()");
diff --git a/AMDiS/src/ElInfo2d.h b/AMDiS/src/ElInfo2d.h
index 8a37387534d7a27ffdc6ccc4c91aa7a77791a86e..c7628110715ba53d98b074dbfdc8ef83d34b6bad 100644
--- a/AMDiS/src/ElInfo2d.h
+++ b/AMDiS/src/ElInfo2d.h
@@ -48,7 +48,7 @@ namespace AMDiS {
     void fillMacroInfo(const MacroElement*);
 
     /// 2-dimensional realisation of ElInfo's worldToCoord method.
-    const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;
+    int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;
 
     /// 2-dimensional realisation of ElInfo's calcGrdLambda method.
     double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
diff --git a/AMDiS/src/ElInfo3d.cc b/AMDiS/src/ElInfo3d.cc
index 4be605592eda9865eda581a045813cdcc3a8eaeb..b6d792b2c77695df58945deb74443088be676b42 100644
--- a/AMDiS/src/ElInfo3d.cc
+++ b/AMDiS/src/ElInfo3d.cc
@@ -318,7 +318,7 @@ namespace AMDiS {
   }
 
 
-  const int ElInfo3d::worldToCoord(const WorldVector<double>& xy,
+  int ElInfo3d::worldToCoord(const WorldVector<double>& xy,
 				   DimVec<double>* lambda) const
   {
     FUNCNAME("ElInfo::worldToCoord()");
diff --git a/AMDiS/src/ElInfo3d.h b/AMDiS/src/ElInfo3d.h
index 38327ca1cc65f9d87a67c2f170f18fa9c69a599e..cd5f6f321eb444b43e069eba999e2541c51b78a9 100644
--- a/AMDiS/src/ElInfo3d.h
+++ b/AMDiS/src/ElInfo3d.h
@@ -60,7 +60,7 @@ namespace AMDiS {
     void fillMacroInfo(const MacroElement *);
 
     /// 3-dimensional realisation of ElInfo's worldToCoord method.
-    const int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;
+    int worldToCoord(const WorldVector<double>& w, DimVec<double>* l) const;
 
     /// 3-dimensional realisation of ElInfo's calcGrdLambda method.
     double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam);
diff --git a/AMDiS/src/Element.h b/AMDiS/src/Element.h
index 57024e4474e6b0a7071525f70bb22aa4a13c6165..6c206d5d84b122ede6c160f9f6a06e6f761d15a9 100644
--- a/AMDiS/src/Element.h
+++ b/AMDiS/src/Element.h
@@ -111,7 +111,7 @@ namespace AMDiS {
 
     /// Returns true if Element is a leaf element (\ref child[0] == NULL), returns
     /// false otherwise.
-    inline const bool isLeaf() const 
+    inline bool isLeaf() const 
     { 
       return (child[0] == NULL); 
     }
@@ -204,7 +204,7 @@ namespace AMDiS {
     virtual int getGeo(GeoIndex i) const = 0;
 
     /// Returns Element's \ref mark
-    inline const int getMark() const 
+    inline int getMark() const 
     { 
       return mark;
     }
diff --git a/AMDiS/src/ElementData.h b/AMDiS/src/ElementData.h
index 09fb8e3079cc7194c700aed0f0070e4ee3c83b5d..0fed27f7088a9354e72ca8f6118b0e136d2cf238 100644
--- a/AMDiS/src/ElementData.h
+++ b/AMDiS/src/ElementData.h
@@ -86,7 +86,7 @@ namespace AMDiS {
     }
 
     /// Returns the id of element data type.
-    virtual const int getTypeID() const 
+    virtual int getTypeID() const 
     {
       return 0;
     }
diff --git a/AMDiS/src/ElementRegion_ED.h b/AMDiS/src/ElementRegion_ED.h
index 18490c6cb0ff2566088ca20555e05a7a5798e548..9f752749060ce483d274e6c19325c0ef8a0721fc 100644
--- a/AMDiS/src/ElementRegion_ED.h
+++ b/AMDiS/src/ElementRegion_ED.h
@@ -64,7 +64,7 @@ namespace AMDiS {
       return "ElementRegion_ED"; 
     }
 
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return ELEMENT_REGION; 
     }
diff --git a/AMDiS/src/Flag.h b/AMDiS/src/Flag.h
index 84997865b8154023cb7ca305a36928b4fe31c510..d3492af66694d97c5d52cfb92d66b3d4b6c32c1d 100644
--- a/AMDiS/src/Flag.h
+++ b/AMDiS/src/Flag.h
@@ -110,7 +110,7 @@ namespace AMDiS {
       flags &= ~f.flags; 
     }
 
-    inline const unsigned long getFlags() const 
+    inline unsigned long getFlags() const 
     { 
       return flags; 
     }
diff --git a/AMDiS/src/Global.cc b/AMDiS/src/Global.cc
index c570cd8230c83552d54baa96274c30f3874a17e9..cdd04baefa137e48dd4207fe63bdc9c337c97c8a 100644
--- a/AMDiS/src/Global.cc
+++ b/AMDiS/src/Global.cc
@@ -349,6 +349,7 @@ namespace AMDiS {
 
   void processMemUsage(double& vm_usage, double& resident_set, bool inMegaByte)
   {
+#ifndef _WIN32
     using std::ios_base;
     using std::ifstream;
     using std::string;
@@ -383,6 +384,9 @@ namespace AMDiS {
       vm_usage /= 1024.0;
       resident_set /= 1024.0;
     }
+#else
+    ERROR("Function not available under MS Windows\n");
+#endif
   }
 
 
diff --git a/AMDiS/src/Global.h b/AMDiS/src/Global.h
index d11c33c9fa8a215f265a40cee768957b4b769a72..bbe98dff069e2f2760b4b66ce54288673fc86d28 100644
--- a/AMDiS/src/Global.h
+++ b/AMDiS/src/Global.h
@@ -52,6 +52,12 @@
 #include <float.h>
 #include <time.h>
 
+#ifdef _WIN32
+#include <io.h>
+#else
+#include <unistd.h>
+#endif
+
 #if HAVE_PARALLEL_DOMAIN_AMDIS
 #include <mpi.h>
 #endif
@@ -133,7 +139,11 @@ namespace AMDiS {
   /// check for file existence
   inline bool file_exists(const std::string filename)
   {
+#ifdef _WIN32
+    return _access(filename.c_str(), 0) == 0;
+#else
     return access(filename.c_str(), F_OK) == 0;
+#endif
   };
 
   /// trim std::string
diff --git a/AMDiS/src/Initfile.cc b/AMDiS/src/Initfile.cc
index f1369ed9c74d235ad2203b840859b8873deda7c9..927dd68ef412f40f255f2f794895a4af76b36f17 100644
--- a/AMDiS/src/Initfile.cc
+++ b/AMDiS/src/Initfile.cc
@@ -65,7 +65,7 @@ namespace AMDiS {
   /// Fill an initfile from an input stream
   void Initfile::read(istream& in) 
   {
-    unsigned line_length = 512;
+    const unsigned line_length = 512;
     char swap[line_length];
     in.getline(swap, line_length);
     while (in.good() || in.gcount() > 0) {
diff --git a/AMDiS/src/LeafData.h b/AMDiS/src/LeafData.h
index 4837f655d3aedd2fa36b3dcbe67453344e46c254..ad97e5855ccf8e5d4e9fb1041947b22b32271e2f 100644
--- a/AMDiS/src/LeafData.h
+++ b/AMDiS/src/LeafData.h
@@ -112,7 +112,7 @@ namespace AMDiS {
       return "LeafDataEstimatable"; 
     }
 
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return ESTIMATABLE; 
     }
@@ -198,7 +198,7 @@ namespace AMDiS {
       return "LeafDataEstimatableVec";
     }
   
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return ESTIMATABLE; 
     }
@@ -294,7 +294,7 @@ namespace AMDiS {
       return "LeafDataCoarsenable";
     }
   
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return COARSENABLE; 
     }
@@ -379,7 +379,7 @@ namespace AMDiS {
       return "LeafDataCoarsenableVec";
     }
   
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return COARSENABLE; 
     }
@@ -484,7 +484,7 @@ namespace AMDiS {
       return "LeafDataPeriodic";
     }
   
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return PERIODIC; 
     }
diff --git a/AMDiS/src/Mesh.h b/AMDiS/src/Mesh.h
index be2eff48b386f1db863cb2709578df461c94ab52..708b24f8584e9f7d5c9495c77139fa6cdb04f85c 100644
--- a/AMDiS/src/Mesh.h
+++ b/AMDiS/src/Mesh.h
@@ -96,49 +96,49 @@ namespace AMDiS {
     }
 
     /// Returns \ref nDofEl of the mesh
-    inline const int getNumberOfAllDofs() const 
+    inline int getNumberOfAllDofs() const 
     { 
       return nDofEl; 
     }
 
     /// Returns \ref nNodeEl of the mesh
-    inline const int getNumberOfNodes() const 
+    inline int getNumberOfNodes() const 
     { 
       return nNodeEl; 
     }
 
     /// Returns \ref nVertices of the mesh
-    inline const int getNumberOfVertices() const 
+    inline int getNumberOfVertices() const 
     { 
       return nVertices; 
     }
 
     /// Returns \ref nEdges of the mesh 
-    inline const int getNumberOfEdges() const 
+    inline int getNumberOfEdges() const 
     { 
       return nEdges; 
     }
 
     /// Returns \ref nFaces of the mesh 
-    inline const int getNumberOfFaces() const 
+    inline int getNumberOfFaces() const 
     { 
       return nFaces; 
     }
 
     /// Returns \ref nLeaves of the mesh 
-    inline const int getNumberOfLeaves() const 
+    inline int getNumberOfLeaves() const 
     { 
       return nLeaves; 
     }
 
     /// Returns \ref nElements of the mesh
-    inline const int getNumberOfElements() const 
+    inline int getNumberOfElements() const 
     { 
       return nElements; 
     }
 
     /// Returns \ref maxEdgeNeigh of the mesh
-    inline const int getMaxEdgeNeigh() const 
+    inline int getMaxEdgeNeigh() const 
     { 
       return maxEdgeNeigh; 
     }
@@ -156,7 +156,7 @@ namespace AMDiS {
     }
 
     /// Returns nDof[i] of the mesh
-    inline const int getNumberOfDofs(int i) const 
+    inline int getNumberOfDofs(int i) const 
     { 
       TEST_EXIT_DBG(i <= dim)("Wrong index: %d %d\n", i, dim);
       return nDof[i]; 
@@ -199,14 +199,14 @@ namespace AMDiS {
 
     /// Returns the size of \ref admin which is the number of the DOFAdmins
     /// belonging to this mesh
-    const int getNumberOfDOFAdmin() const 
+    int getNumberOfDOFAdmin() const 
     {
       return admin.size();
     }
 
     /// Returns the size of \ref macroElements which is the number of
     /// of macro elements of this mesh
-    const int getNumberOfMacros() const 
+    int getNumberOfMacros() const 
     {
       return macroElements.size();
     }
diff --git a/AMDiS/src/MeshStructure_ED.h b/AMDiS/src/MeshStructure_ED.h
index fb288947cb379a16bd58c3b0ef0dff4d2528b77c..d23d70bf0fd5a93383c8bae4a350e9ed9ac68c67 100644
--- a/AMDiS/src/MeshStructure_ED.h
+++ b/AMDiS/src/MeshStructure_ED.h
@@ -84,7 +84,7 @@ namespace AMDiS {
       return true;
     }
 
-    virtual const int getTypeID() const 
+    virtual int getTypeID() const 
     {
       return MESH_STRUCTURE;
     }
diff --git a/AMDiS/src/QPsiPhi.cc b/AMDiS/src/QPsiPhi.cc
index 263845ed9b3b236c454d5f7bd0f48f8f2430399a..b578684f9c3dd3f62ba539156b284d83edc1689c 100644
--- a/AMDiS/src/QPsiPhi.cc
+++ b/AMDiS/src/QPsiPhi.cc
@@ -176,7 +176,7 @@ namespace AMDiS {
   }
 
 
-  const bool Q11PsiPhi::operator==(const Q11PsiPhi& q11pp) const
+  bool Q11PsiPhi::operator==(const Q11PsiPhi& q11pp) const
   {
     return (q11pp.psi == psi && q11pp.phi == phi && q11pp.quadrature == quadrature);
   }
@@ -337,7 +337,7 @@ namespace AMDiS {
     }
   }
 
-  const bool Q10PsiPhi::operator==(const Q10PsiPhi& q10pp) const
+  bool Q10PsiPhi::operator==(const Q10PsiPhi& q10pp) const
   {
     return (q10pp.psi == psi && q10pp.phi == phi && q10pp.quadrature == quadrature);
   }
@@ -498,7 +498,7 @@ namespace AMDiS {
     }
   }
 
-  const bool Q01PsiPhi::operator==(const Q01PsiPhi& q01pp) const
+  bool Q01PsiPhi::operator==(const Q01PsiPhi& q01pp) const
   {
     return (q01pp.psi == psi && q01pp.phi == phi && q01pp.quadrature == quadrature);
   }
@@ -543,7 +543,7 @@ namespace AMDiS {
   /*  first order term:                                                       */
   /****************************************************************************/
 
-  const double Q00PsiPhi::getValue(unsigned int i,unsigned  int j) const
+  double Q00PsiPhi::getValue(unsigned int i,unsigned  int j) const
   {
     if ((values)&&(values[i])) return values[i][j];
     return 0.;
@@ -621,7 +621,7 @@ namespace AMDiS {
     delete [] values;
   }
 
-  const bool Q00PsiPhi::operator==(const Q00PsiPhi& q00pp) const
+  bool Q00PsiPhi::operator==(const Q00PsiPhi& q00pp) const
   {
     return (q00pp.psi == psi && q00pp.phi == phi && q00pp.quadrature == quadrature);
   }
@@ -702,7 +702,7 @@ namespace AMDiS {
     delete [] values;
   }
 
-  const bool Q0Psi::operator==(const Q0Psi& q0p) const
+  bool Q0Psi::operator==(const Q0Psi& q0p) const
   {
     return (q0p.psi == psi && q0p.quadrature == quadrature);
   }
@@ -825,7 +825,7 @@ namespace AMDiS {
   }
 
 
-  const bool Q1Psi::operator==(const Q1Psi& q1p) const
+  bool Q1Psi::operator==(const Q1Psi& q1p) const
   {
     return (q1p.psi == psi && q1p.quadrature == quadrature);
   }
diff --git a/AMDiS/src/QPsiPhi.h b/AMDiS/src/QPsiPhi.h
index 455af55a607025914bbf03bdc38abfe43576f46e..fe97e3126fd2b93e701d7663e64f92fabef631c8 100644
--- a/AMDiS/src/QPsiPhi.h
+++ b/AMDiS/src/QPsiPhi.h
@@ -119,16 +119,16 @@ namespace AMDiS {
 					     const Quadrature*);
     
     /// Compares two Q11PsiPhi objects.
-    const bool operator==(const Q11PsiPhi&) const;
+    bool operator==(const Q11PsiPhi&) const;
 
     /// Compares two Q11PsiPhi objects.
-    const bool operator!=(const Q11PsiPhi& q11pp) const
+    bool operator!=(const Q11PsiPhi& q11pp) const
     { 
       return !(operator==(q11pp));
     }
     
     /// Returns \ref values[i][j][k]
-    inline const double getValue(unsigned int i,
+    inline double getValue(unsigned int i,
 				 unsigned int j,
 				 unsigned int v) const 
     {
@@ -140,7 +140,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref nrEntries[i][j]
-    inline const int getNumberEntries(unsigned int i, unsigned int j) const
+    inline int getNumberEntries(unsigned int i, unsigned int j) const
     {
       if (nrEntries && nrEntries[i]) 
 	return nrEntries[i][j];
@@ -155,7 +155,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref k[i1][i2][i3]
-    inline const int getK(unsigned int i1, 
+    inline int getK(unsigned int i1, 
 			  unsigned int i2, 
 			  unsigned int i3) const
     {
@@ -166,7 +166,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref l[i][j][v]
-    inline const int getL(unsigned int i, unsigned int j, unsigned int v) const
+    inline int getL(unsigned int i, unsigned int j, unsigned int v) const
     {
       if (l && l[i] && l[i][j] && (static_cast<int>(v) < nrEntries[i][j]))
 	return l[i][j][v];
@@ -276,16 +276,16 @@ namespace AMDiS {
 					     const Quadrature*);
     
     /// Compares two Q10PsiPhi objects.
-    const bool operator==(const Q10PsiPhi&) const;
+    bool operator==(const Q10PsiPhi&) const;
 
     /// Compares two Q10PsiPhi objects.
-    const bool operator!=(const Q10PsiPhi& q10pp) const
+    bool operator!=(const Q10PsiPhi& q10pp) const
     { 
       return !(operator==(q10pp));
     }
 
     /// Returns \ref values[i][j][k]
-    inline const double getValue(unsigned int i,
+    inline double getValue(unsigned int i,
 				 unsigned int j,
 				 unsigned int v) const 
     {
@@ -297,7 +297,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref nrEntries[i][j]
-    inline const int getNumberEntries(unsigned int i, unsigned int j) const 
+    inline int getNumberEntries(unsigned int i, unsigned int j) const 
     {
       if (nrEntries && nrEntries[i]) 
 	return nrEntries[i][j];
@@ -312,7 +312,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref k[i1][i2][i3]
-    inline const int getK(unsigned int i1, 
+    inline int getK(unsigned int i1, 
 			  unsigned int i2, 
 			  unsigned int i3) const 
     {
@@ -409,16 +409,16 @@ namespace AMDiS {
 					     const Quadrature*);
     
     /// Compares two Q01PsiPhi objects.
-    const bool operator==(const Q01PsiPhi&) const;
+    bool operator==(const Q01PsiPhi&) const;
 
     /// Compares two Q01PsiPhi objects.
-    const bool operator!=(const Q01PsiPhi& q01pp) const 
+    bool operator!=(const Q01PsiPhi& q01pp) const 
     { 
       return !(operator==(q01pp));
     }
 
     /// Returns \ref values[i][j][k]
-    inline const double getValue(unsigned int i,
+    inline double getValue(unsigned int i,
 				 unsigned int j,
 				 unsigned int v) const
     {
@@ -430,7 +430,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref nrEntries[i][j]
-    inline const int getNumberEntries(unsigned int i, unsigned int j) const
+    inline int getNumberEntries(unsigned int i, unsigned int j) const
     {
       if (nrEntries && nrEntries[i]) 
 	return nrEntries[i][j];
@@ -445,7 +445,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref k[i1][i2][i3]
-    inline const int getK(unsigned int i1, 
+    inline int getK(unsigned int i1, 
 			  unsigned int i2, 
 			  unsigned int i3) const;
 
@@ -468,7 +468,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref k[i][j][v]
-    inline const int getL(unsigned int i, 
+    inline int getL(unsigned int i, 
 			  unsigned int j, 
 			  unsigned int v) const
     {
@@ -565,16 +565,16 @@ namespace AMDiS {
 				       const Quadrature*);
   
     /// Compares two Q00PsiPhi objects.
-    const bool operator==(const Q00PsiPhi&) const;
+    bool operator==(const Q00PsiPhi&) const;
 
     /// Compares two Q00PsiPhi objects.
-    const bool operator!=(const Q00PsiPhi& q00pp) const 
+    bool operator!=(const Q00PsiPhi& q00pp) const 
     { 
       return !(operator==(q00pp));
     }
   
     /// Returns \ref values[i][j]
-    const double getValue(unsigned int i, unsigned int j) const;
+    double getValue(unsigned int i, unsigned int j) const;
 
     /// Returns \ref values[i]
     const double *getValVec(unsigned int i) const;  
@@ -614,16 +614,16 @@ namespace AMDiS {
     static Q0Psi* provideQ0Psi(const BasisFunction *, const Quadrature*);
   
     /// Compares two Q0Psi objects.
-    const bool operator==(const Q0Psi&) const;
+    bool operator==(const Q0Psi&) const;
 
     /// Compares two Q0Psi objects.
-    const bool operator!=(const Q0Psi& q0p) const 
+    bool operator!=(const Q0Psi& q0p) const 
     { 
       return !(operator==(q0p));
     }
   
     /// Returns \ref value
-    inline const double getValue(int i) const 
+    inline double getValue(int i) const 
     { 
       return values[i]; 
     }
@@ -658,16 +658,16 @@ namespace AMDiS {
 				     const Quadrature*);
     
     /// Compares two Q1Psi objects.
-    const bool operator==(const Q1Psi&) const;
+    bool operator==(const Q1Psi&) const;
 
     /// Compares two Q1Psi objects.
-    const bool operator!=(const Q1Psi& q1p) const 
+    bool operator!=(const Q1Psi& q1p) const 
     { 
       return !(operator==(q1p));
     }
     
     /// Returns \ref values[i][j]
-    inline const double getValue(unsigned int i,
+    inline double getValue(unsigned int i,
 				 unsigned int j) const 
     {
       if (values && values[i] && (static_cast<int>(j) < nrEntries[i]))
@@ -677,7 +677,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref nrEntries[i]
-    inline const int getNumberEntries(unsigned int i) const
+    inline int getNumberEntries(unsigned int i) const
     {
       return (nrEntries ? nrEntries[i] : 0);
     }
@@ -689,7 +689,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref k[i1][i2]
-    inline const int 
+    inline int 
     getK(unsigned int i1, unsigned int i2) const
     {
       if (k && k[i1] && (static_cast<int>(i2) < nrEntries[i1])) 
diff --git a/AMDiS/src/Quadrature.cc b/AMDiS/src/Quadrature.cc
index 53169448ff78c6960a9c99dd9c27c00326c5bc59..c81ccf5001cab8ce2edcb9ab0eb1a22c1780c22f 100644
--- a/AMDiS/src/Quadrature.cc
+++ b/AMDiS/src/Quadrature.cc
@@ -1622,7 +1622,7 @@ namespace AMDiS {
   }
 
 
-  const double FastQuadrature::getSecDer(int q,int i ,int j, int m) const 
+  double FastQuadrature::getSecDer(int q,int i ,int j, int m) const 
   {
     return (D2Phi) ? (*D2Phi)[q][i][j][m] : 0.0;
   }
diff --git a/AMDiS/src/Quadrature.h b/AMDiS/src/Quadrature.h
index 8424a213ff6cb357e82837a01d7ce1bef6293f2a..88453b8e97127ba5192063645639cc93a26c62d8 100644
--- a/AMDiS/src/Quadrature.h
+++ b/AMDiS/src/Quadrature.h
@@ -369,13 +369,13 @@ namespace AMDiS {
     }
 
     /// Returns (*\ref D2Phi)[q][i][j][m]
-    const double getSecDer(int q, int i, int j, int m) const;
+    double getSecDer(int q, int i, int j, int m) const;
 
     /// Returns (*\ref D2Phi)[q]
     const VectorOfFixVecs<DimMat<double> > *getSecDer(int q) const;
 
     /// Returns (*\ref grdPhi)[q][i][j]
-    inline const double getGradient(int q, int i ,int j) const 
+    inline double getGradient(int q, int i ,int j) const 
     {
       return (!grdPhi.empty()) ? grdPhi[q][i][j] : 0.0;
     }
@@ -397,7 +397,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref phi[q][i]
-    inline const double getPhi(int q, int i) const 
+    inline double getPhi(int q, int i) const 
     {
       return phi[q][i];
     }
diff --git a/AMDiS/src/RCNeighbourList.h b/AMDiS/src/RCNeighbourList.h
index a4886d0a517824233ee6ce666439821bb37841f8..cdc7281c6afef58ec5a5936428b4699828af359f 100644
--- a/AMDiS/src/RCNeighbourList.h
+++ b/AMDiS/src/RCNeighbourList.h
@@ -70,7 +70,7 @@ namespace AMDiS {
     }
 
     /// Returns \ref rclist[i].flag
-    inline const bool isPatchCoarse(int i) const 
+    inline bool isPatchCoarse(int i) const 
     {
       return rclist[i]->flag;
     }
diff --git a/AMDiS/src/ScalableQuadrature.h b/AMDiS/src/ScalableQuadrature.h
index c6d63434d89fe0e63776ecf3482f82a10c7103db..10ac21b06886926d08b4946a371cea5847dae309 100644
--- a/AMDiS/src/ScalableQuadrature.h
+++ b/AMDiS/src/ScalableQuadrature.h
@@ -77,7 +77,7 @@ namespace AMDiS {
     void scaleQuadrature(DimMat<double> *scalMat);
 
     /// Get b-th coordinate of the a-th original quadrature point.
-    inline const double getOldLambda(int a, int b) const 
+    inline double getOldLambda(int a, int b) const 
     {
       if (oldLambda) 
 	return (*oldLambda)[a][b]; 
diff --git a/AMDiS/src/SubElInfo.h b/AMDiS/src/SubElInfo.h
index 0364005666052a1c7ef4f9cd7660c308f4484c97..5ea226d95f1ee31952fd6669702f110aa1909b7f 100644
--- a/AMDiS/src/SubElInfo.h
+++ b/AMDiS/src/SubElInfo.h
@@ -53,7 +53,7 @@ namespace AMDiS {
     }
 
     /// Get b-th coordinate of the a-th vertex of subelement (barycentriccoordinates). 
-    inline const double getLambda(int a, int b) const 
+    inline double getLambda(int a, int b) const 
     {
       if (lambda) 
 	return (*lambda)[a][b]; 
@@ -74,7 +74,7 @@ namespace AMDiS {
     }
 
     /// Get determinant corresponding to subelement.
-    inline const double getDet() const 
+    inline double getDet() const 
     {
       return det;
     }
diff --git a/AMDiS/src/SurfaceRegion_ED.h b/AMDiS/src/SurfaceRegion_ED.h
index f427fab764b432652e3df67ca38326f077c7dfb6..b87f2e75f532711f4cfa647d56501354c8d8f21b 100644
--- a/AMDiS/src/SurfaceRegion_ED.h
+++ b/AMDiS/src/SurfaceRegion_ED.h
@@ -65,7 +65,7 @@ namespace AMDiS {
       return "SurfaceRegion_ED"; 
     }
 
-    inline const int getTypeID() const 
+    inline int getTypeID() const 
     { 
       return SURFACE_REGION; 
     }
diff --git a/AMDiS/src/compositeFEM/ElementLevelSet.h b/AMDiS/src/compositeFEM/ElementLevelSet.h
index 4fd0fa78d4e2d8478aa90f0ffbe60ed1ac0af2fa..acf4dc05cf8fab7e10fa0058192d3ddddc806fb3 100644
--- a/AMDiS/src/compositeFEM/ElementLevelSet.h
+++ b/AMDiS/src/compositeFEM/ElementLevelSet.h
@@ -167,7 +167,7 @@ public:
 			    const bool doCalcIntersecPts_ = true);
 
   /// Gets value of level set function at point given in barycentric coordinates.
-  inline const double calcLevelSetFct(const DimVec<double>& bary) 
+  inline double calcLevelSetFct(const DimVec<double>& bary) 
   {
     return (*lSFct)(bary);
   }
@@ -246,7 +246,7 @@ public:
   }
 
   /// Get i-th component of vector elVertexLevelSetVec.
-  inline const double getElVertLevelSetVec(const int i) const 
+  inline double getElVertLevelSetVec(const int i) const 
   {
     return elVertexLevelSetVec[i];
   }
diff --git a/AMDiS/src/io/ArhReader.cc b/AMDiS/src/io/ArhReader.cc
index e125376b0c59aacd8f4176c30d187ac46ad36056..c9c082b9e474dc960b292e03fc537992a9ef1df0 100644
--- a/AMDiS/src/io/ArhReader.cc
+++ b/AMDiS/src/io/ArhReader.cc
@@ -133,7 +133,7 @@ namespace AMDiS {
 
     for (std::set<int>::iterator it = readArhFiles.begin();
 	 it != readArhFiles.end(); ++it) {
-      string arhFilename = directory.native() + "/" + arhPrefix;
+      string arhFilename = directory.string() + "/" + arhPrefix;
       if (nProc == 1)
 	arhFilename += ".arh";
       else
diff --git a/AMDiS/src/io/ElementFileWriter.cc b/AMDiS/src/io/ElementFileWriter.cc
index 2806f919669c1fde21ae6c96be3cf698315e8232..79783757b75cf05bbbb369ed9706ccdb856ca73d 100644
--- a/AMDiS/src/io/ElementFileWriter.cc
+++ b/AMDiS/src/io/ElementFileWriter.cc
@@ -409,7 +409,7 @@ namespace AMDiS {
 	int idx = elInfo->getElement()->getIndex();
 	
 	for (int j = 0; j < nComponents; j++) {
-	  double val = (vec != NULL ? (*vec)[idx] : ((*vecs)[idx].size()==dataLength ? (*vecs)[idx][i*nComponents+j] : 0.0));
+	  double val = (vec != NULL ? (*vec)[idx] : (static_cast<int>((*vecs)[idx].size())==dataLength ? (*vecs)[idx][i*nComponents+j] : 0.0));
 
 	  // Write value for each vertex of each element.
 	  if (fabs(val) < 1.e-40)
diff --git a/AMDiS/src/io/MacroInfo.cc b/AMDiS/src/io/MacroInfo.cc
index 4367338e3bb8979b3822f5956202b649b3fa6ffc..e110f38a938940969d38ded720e056f6ab6d9583 100644
--- a/AMDiS/src/io/MacroInfo.cc
+++ b/AMDiS/src/io/MacroInfo.cc
@@ -227,7 +227,7 @@ namespace AMDiS {
     file = fopen(filename.c_str(), "r");
     TEST_EXIT(file)("cannot open file %s\n", filename.c_str());
 
-    int result;
+    int result, n_;
 
     for (int i_key = 0; i_key < n_keys; i_key++) {
 
@@ -283,7 +283,7 @@ namespace AMDiS {
 
       case 4:
 	// block "vertex coordinates"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 	for (int i = 0; i < nVertices; i++) {
 	  for (j = 0; j <Global::getGeo(WORLD) ; j++) {
 	    result = fscanf(file, "%lf", &dbl);
@@ -297,7 +297,7 @@ namespace AMDiS {
 
       case 5:
 	// block "element vertices"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 
 	// === Global number of vertices on a single element. ===
 
@@ -315,7 +315,7 @@ namespace AMDiS {
 
       case 6:
 	// block "element boundaries"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 
 
 	// === MEL boundary pointers. ===
@@ -341,7 +341,7 @@ namespace AMDiS {
 
       case 7:
 	// block "element neighbours"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 
 	// ===  Fill MEL neighbour pointers:                               ===
 	// ===    if they are specified in the file: read them from file,  ===
@@ -368,7 +368,7 @@ namespace AMDiS {
 
       case 8:
 	// block "element type"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 
 	// === MEL elType ===
 
@@ -389,7 +389,7 @@ namespace AMDiS {
       case 9:
 	// block "projections"
 	{
-	  fscanf(file, "%*s");
+	  n_ = fscanf(file, "%*s");
 
 	  int nFaces = mesh->getGeo(FACE);
 	  int nEdgesAtBoundary = 0;
@@ -427,7 +427,7 @@ namespace AMDiS {
 
       case 10:
 	// block "element region"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 
 	// === MEL regions. ===
 
@@ -448,7 +448,7 @@ namespace AMDiS {
 
       case 11:
 	// block "surface region"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 	for (int i = 0; i < nElements; i++) {
 	  result = read_indices(file, *ind);
 	  TEST_EXIT(result)
@@ -471,12 +471,12 @@ namespace AMDiS {
 
       case 12:
 	// line "mesh name"
-	fscanf(file, "%*s %*s %*s");
+	n_ = fscanf(file, "%*s %*s %*s");
 	break;
 
       case 13:
 	// line "time"
-	fscanf(file, "%*s %*s");
+	n_ = fscanf(file, "%*s %*s");
 	break;
       }
     }
diff --git a/AMDiS/src/reinit/ElementLevelSet.h b/AMDiS/src/reinit/ElementLevelSet.h
index 0a45ca5cc3c8d72e54ce7a29555ba80003cb1f05..772767a9e4b76abb71b78c078c5c79402afa8fe6 100644
--- a/AMDiS/src/reinit/ElementLevelSet.h
+++ b/AMDiS/src/reinit/ElementLevelSet.h
@@ -235,7 +235,7 @@ class ElementLevelSet
   }
 
   /// Get i-th component of vector elVertexLevelSetVec.
-  inline const double getElVertLevelSetVec(const int i) const 
+  inline double getElVertLevelSetVec(const int i) const 
   {
     return elVertexLevelSetVec[i];
   }
diff --git a/AMDiS/src/reinit/ElementUpdate_3d.cc b/AMDiS/src/reinit/ElementUpdate_3d.cc
index aa13858230d2863d3bb42cbd27be0bce65a1fe7a..e836964772c23023bce5a66bc2e0c1756fda3548 100644
--- a/AMDiS/src/reinit/ElementUpdate_3d.cc
+++ b/AMDiS/src/reinit/ElementUpdate_3d.cc
@@ -459,7 +459,7 @@ ElementUpdate_3d::rotateElement(
   return true;
 }
 
-const int 
+int 
 ElementUpdate_3d::calcPosition(const WorldVector<double> &B2,
 			       const WorldVector<double> &C2,
 			       const WorldVector<double> &D2)
diff --git a/AMDiS/src/reinit/ElementUpdate_3d.h b/AMDiS/src/reinit/ElementUpdate_3d.h
index 0ee4396986f99ffa92bcebf3653d79315b8a6941..eb768f69da2550a3de2bbeb5f2fb9fc51377adaf 100644
--- a/AMDiS/src/reinit/ElementUpdate_3d.h
+++ b/AMDiS/src/reinit/ElementUpdate_3d.h
@@ -93,7 +93,7 @@ public:
    * Note: Limited to triangles with angles not greater than Pi/2
    *       (acute triangles).
    */
-  const int calcPosition(const WorldVector<double> &B2,
+  int calcPosition(const WorldVector<double> &B2,
 			 const WorldVector<double> &C2,
 			 const WorldVector<double> &D2);
 
diff --git a/AMDiS/src/time/RosenbrockAdaptInstationary.cc b/AMDiS/src/time/RosenbrockAdaptInstationary.cc
index 0cb1b9389e5b5fdc5286e5ce5a09c579262e2bfd..2873208a49477e91a8861b2dee1f5acbe1c90a02 100644
--- a/AMDiS/src/time/RosenbrockAdaptInstationary.cc
+++ b/AMDiS/src/time/RosenbrockAdaptInstationary.cc
@@ -126,7 +126,7 @@ namespace AMDiS {
 	  adaptInfo->setTime(adaptInfo->getTime() - dbgTimesteps[studyTimestep]);
 
 	studyTimestep++;
-	TEST_EXIT(studyTimestep < dbgTimesteps.size())("Should not happen!\n");
+	TEST_EXIT(studyTimestep < static_cast<int>(dbgTimesteps.size()))("Should not happen!\n");
 	
 	adaptInfo->setTimestep(dbgTimesteps[studyTimestep]);
       }
@@ -236,7 +236,7 @@ namespace AMDiS {
       if (fixFirstTimesteps > 0)
 	fixFirstTimesteps--;     
     } while (rejected || 
-	     (dbgTimestepStudy && (studyTimestep + 1 < dbgTimesteps.size())));
+	     (dbgTimestepStudy && (studyTimestep + 1 < static_cast<int>(dbgTimesteps.size()))));
 
     rosenbrockStat->acceptTimestep();