diff --git a/AMDiS/src/AdaptInfo.h b/AMDiS/src/AdaptInfo.h
index 0c10da50e8532946190d31b7c3963ccd4f517647..ca668ec1c57f00ddbff8354b425b8d690af3c7ad 100644
--- a/AMDiS/src/AdaptInfo.h
+++ b/AMDiS/src/AdaptInfo.h
@@ -363,6 +363,12 @@ namespace AMDiS {
       return timestepNumber; 
     }
 
+    /// Sets \ref timestepNumber.
+    inline void setTimestepNumber(int num) 
+    {
+      timestepNumber = AMDiS::min(nTimesteps,num);
+    }
+    
     /// Returns \ref nTimesteps.
     inline int getNumberOfTimesteps() 
     {
@@ -372,7 +378,7 @@ namespace AMDiS {
     /// Sets \ref nTimesteps.
     inline void setNumberOfTimesteps(int num) 
     {
-      nTimesteps = num;
+      nTimesteps = AMDiS::max(0,num);
     }
 
     /// Increments \ref timestepNumber by 1;
@@ -550,7 +556,7 @@ namespace AMDiS {
     { 
       return maxTimestep; 
     }  
-
+    
     /// Gets \ref &timestep
     inline double *getTimestepPtr() 
     { 
@@ -756,7 +762,7 @@ namespace AMDiS {
 
     /// Maximal step size
     double maxTimestep;
-
+    
     /// Number of current time step
     int timestepNumber;
 
diff --git a/AMDiS/src/DOFAdmin.cc b/AMDiS/src/DOFAdmin.cc
index 0d79e55ee6b125b5752406c65d3167497dd8401a..e66f5d6e1fbaa0a8989e6a8cb29eb445cd68aeed 100644
--- a/AMDiS/src/DOFAdmin.cc
+++ b/AMDiS/src/DOFAdmin.cc
@@ -311,7 +311,6 @@ namespace AMDiS {
     for (di = dofIndexedList.begin(); di != end; ++di)
       (*di)->compressDOFIndexed(first, last, new_dof);
 
-  
     std::list<DOFContainer*>::iterator dc;
     std::list<DOFContainer*>::iterator endc = dofContainerList.end();
     for (dc = dofContainerList.begin(); dc != endc; ++dc)