diff --git a/regtest/analysis/rt43/histo.1.reference b/regtest/analysis/rt43/analysis.0.histo.reference
similarity index 100%
rename from regtest/analysis/rt43/histo.1.reference
rename to regtest/analysis/rt43/analysis.0.histo.reference
diff --git a/src/analysis/Analysis.cpp b/src/analysis/Analysis.cpp
index 606992bcf26c4a0793c44dcccc13e8c49a614062..e4ab30dc83f988290234c13409fe31b80c34b3eb 100644
--- a/src/analysis/Analysis.cpp
+++ b/src/analysis/Analysis.cpp
@@ -158,7 +158,6 @@ old_norm(0.0)
           // Setup the restart file (append mode)
           if( write_chq ) rfile.open( filename.c_str() );  // In append mode automatically because of restart
           // Run the analysis if we stoped in the middle of it last time
-          if( idata==ndata ) runAnalysis();
           log.printf("  restarting analysis with %u points read from restart file\n",idata);
       } else if( write_chq ){
           // Setup the restart file (delete any old one)
@@ -200,6 +199,9 @@ void Analysis::prepare(){
 void Analysis::calculate(){
   // Don't store the first step (also don't store if we are getting data from elsewhere)
   if( getStep()==0 || reusing_data ) return;
+  // This is used when we have a full quota of data from the first run
+  if( idata==logweights.size() ) return; 
+
   // Retrieve the bias
   double bias=0.0; for(unsigned i=0;i<biases.size();++i) bias+=biases[i]->get();
 
@@ -327,28 +329,5 @@ void Analysis::runFinalJobs() {
   runAnalysis(); 
 }
 
-std::string Analysis::saveResultsFromPreviousAnalyses( const std::string & filename ){
-  FILE* ff=std::fopen( filename.c_str() ,"r");
-  // Perhaps replace this with an warning and a backup at some stage
-  if(ff && !firstAnalysisDone) error("found file named " + filename + " from previous calculation");
-  FILE* fff=NULL; std::string num, backup;
-  if( ff ){
-     FILE* fff=NULL;
-     for(unsigned i=1;;i++){
-         Tools::convert(i,num);
-         backup=filename + "." + num;
-         fff=std::fopen(backup.c_str(),"r");
-         if(!fff) break;
-     }   
-     int check=rename(filename.c_str(), backup.c_str() );
-     plumed_massert(check==0,"renaming " + filename + " to " + backup + " failed");
-  } else {
-     return "";
-  }
-  if(ff) fclose(ff);
-  if(fff) fclose(fff); 
-  return backup; 
-} 
-
 }
 }
diff --git a/src/analysis/Analysis.h b/src/analysis/Analysis.h
index 39b27668e1fa1c9917caee1527b9287d355f85bd..6358c1adb8b464e0d662c2d93e661fc4437067a9 100644
--- a/src/analysis/Analysis.h
+++ b/src/analysis/Analysis.h
@@ -100,8 +100,6 @@ protected:
   double getNormalization() const;
 /// Are we analyzing each data block separately (if we are not this also returns the old normalization )
   bool usingMemory() const; 
-/// Save the results in files from previous runs of the analysis algorithm
-  std::string saveResultsFromPreviousAnalyses( const std::string & filename );
 /// Convert the stored log weights to proper weights
   void finalizeWeights( const bool& ignore_weights );
 /// Overwrite ActionWithArguments getArguments() so that we don't return
diff --git a/src/analysis/Histogram.cpp b/src/analysis/Histogram.cpp
index 16b909bfe670f8803fb568ba8e18e9a0cf26b71a..14a672d2ca1b2c40782abeead545b603e6ba52be 100644
--- a/src/analysis/Histogram.cpp
+++ b/src/analysis/Histogram.cpp
@@ -145,7 +145,7 @@ gbin(getNumberOfArguments())
 
 void Histogram::performAnalysis(){
   // Back up old histogram files
-  std::string oldfname=saveResultsFromPreviousAnalyses( gridfname );
+//  std::string oldfname=saveResultsFromPreviousAnalyses( gridfname );
 
   // Get pbc stuff for grid
   std::vector<bool> pbc; std::string dmin,dmax;
@@ -153,9 +153,10 @@ void Histogram::performAnalysis(){
      pbc.push_back( getPeriodicityInformation(i,dmin,dmax) );
      if(pbc[i]){ Tools::convert(dmin,gmin[i]); Tools::convert(dmax,gmax[i]); }
   }
-  Grid* gg; 
-  if( oldfname.length()>0 && usingMemory() ){
-      IFile oldf; oldf.link(*this); oldf.open(oldfname);
+
+  Grid* gg; IFile oldf; oldf.link(*this); 
+  if( usingMemory() && oldf.FileExist(gridfname) ){
+      oldf.open(gridfname);
       gg = Grid::create( "probs", getArguments(), oldf, gmin, gmax, gbin, false, false, false );
       oldf.close();
   } else {
@@ -175,7 +176,7 @@ void Histogram::performAnalysis(){
 
   // Write the grid to a file
   OFile gridfile; gridfile.link(*this); 
-  gridfile.open( gridfname ); gg->writeToFile( gridfile );
+  gridfile.open( gridfname, "analysis" ); gg->writeToFile( gridfile );
   // Close the file 
   gridfile.close(); delete gg;
 }
diff --git a/src/tools/OFile.cpp b/src/tools/OFile.cpp
index 28caee7c677e6798785f684a23b7e5794c5411c4..569395d69fc51e2656dc47f7ac0354591fde8e5e 100644
--- a/src/tools/OFile.cpp
+++ b/src/tools/OFile.cpp
@@ -210,7 +210,7 @@ OFile& OFile::printField(){
   return *this;
 }
 
-OFile& OFile::open(const std::string&path){
+OFile& OFile::open(const std::string&path, const std::string& backstring ){
   plumed_assert(!cloned);
   eof=false;
   err=false;
@@ -236,7 +236,7 @@ OFile& OFile::open(const std::string&path){
            std::string num;
            Tools::convert(i,num);
            if(i>maxbackup) plumed_merror("cannot backup file "+file+" maximum number of backup is "+num+"\n");
-           backup=directory+"bck."+num+"."+file;
+           backup=directory+backstring +"."+num+"."+file;
            fff=std::fopen(backup.c_str(),"r");
            if(!fff) break;
          }
diff --git a/src/tools/OFile.h b/src/tools/OFile.h
index a1cab21d8317681901cbbed4a616cf748b393101..c3611e56e03c974b684eeee259ebe6f8174056aa 100644
--- a/src/tools/OFile.h
+++ b/src/tools/OFile.h
@@ -131,7 +131,7 @@ public:
 /// be either opened explicitly, linked to a FILE or linked to a OFile
   OFile& link(OFile&);
 /// Opens the file using automatic append/backup
-  OFile& open(const std::string&name);
+  OFile& open(const std::string&name, const std::string& backstring="bck");
 /// Set the prefix for output.
 /// Typically "PLUMED: ". Notice that lines with a prefix cannot
 /// be parsed using fields in a IFile.