Index: src/bond.cpp
===================================================================
--- src/bond.cpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/bond.cpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -25,5 +25,5 @@
  * \param number increasing index
  */
-bond::bond(atom *left, atom *right, int degree, int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
+bond::bond(atom *left, atom *right, const int degree, const int number) : leftatom(left), rightatom(right), previous(NULL), next(NULL), HydrogenBond(0), BondDegree(degree), nr(number), Cyclic(false), Type(Undetermined), Used(white)
 {
   if ((left != NULL) && (right != NULL)) {
@@ -47,5 +47,5 @@
 };
 
-ostream & operator << (ostream &ost, const bond &b) 
+ostream & operator << (ostream &ost, const bond &b)
 {
   ost << "[" << b.leftatom->Name << " <" << b.BondDegree << "(H" << b.HydrogenBond << ")>" << b.rightatom->Name << "]";
@@ -57,5 +57,5 @@
  * \return pointer to the other atom in the bond, NULL if no match (indicates something's wrong with the bond) 
  */
-atom * bond::GetOtherAtom(const ParticleInfo *Atom) const
+atom * bond::GetOtherAtom(const ParticleInfo * const Atom) const
 {
   if(leftatom == Atom) 
@@ -80,5 +80,5 @@
  * \return true if it is either bond::leftatom or bond::rightatom, false otherwise
  */
-bool bond::Contains(const ParticleInfo *ptr)
+bool bond::Contains(const ParticleInfo * const ptr)
 {
   return ((leftatom == ptr) || (rightatom == ptr));
@@ -97,5 +97,5 @@
  * \return bond::Used, false if bond was already marked used
  */
-bool bond::MarkUsed(enum Shading color) {
+bool bond::MarkUsed(const enum Shading color) {
   if (Used == black) {
     cerr << "ERROR: Bond " << this << " was already marked black!." << endl;
Index: src/bond.hpp
===================================================================
--- src/bond.hpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/bond.hpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -44,14 +44,14 @@
     enum EdgeType Type;//!< whether this is a tree or back edge
 
-  atom * GetOtherAtom(const ParticleInfo *Atom) const;
+  atom * GetOtherAtom(const ParticleInfo * const Atom) const;
 
-  bool MarkUsed(enum Shading color);
+  bool MarkUsed(const enum Shading color);
   enum Shading IsUsed();
   void ResetUsed();
-  bool Contains(const ParticleInfo *ptr);
+  bool Contains(const ParticleInfo * const ptr);
   bool Contains(const int nr);
 
   bond();
-  bond(atom *left, atom *right, int degree=1, int number=0);
+  bond(atom *left, atom *right, const int degree=1, const int number=0);
   ~bond();
 
Index: src/config.cpp
===================================================================
--- src/config.cpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/config.cpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -52,21 +52,13 @@
 /** Constructor for ConfigFileBuffer class.
  */
-ConfigFileBuffer::ConfigFileBuffer()
+ConfigFileBuffer::ConfigFileBuffer() : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
 {
-  NoLines = 0;
-  CurrentLine = 0;
-  buffer = NULL;
-  LineMapping = NULL;
-}
+};
 
 /** Constructor for ConfigFileBuffer class with filename to be parsed.
  * \param *filename file name
  */
-ConfigFileBuffer::ConfigFileBuffer(char *filename)
+ConfigFileBuffer::ConfigFileBuffer(const char * const filename) : buffer(NULL), LineMapping(NULL), CurrentLine(0), NoLines(0)
 {
-  NoLines = 0;
-  CurrentLine = 0;
-  buffer = NULL;
-  LineMapping = NULL;
   ifstream *file = NULL;
   char line[MAXSTRINGSIZE];
@@ -141,5 +133,5 @@
  * \param NoAtoms of subsequent lines to look at
  */
-void ConfigFileBuffer::MapIonTypesInBuffer(int NoAtoms)
+void ConfigFileBuffer::MapIonTypesInBuffer(const int NoAtoms)
 {
   map<const char *, int, IonTypeCompare> LineList;
@@ -168,6 +160,12 @@
 /** Constructor for config file class.
  */
-config::config()
-{
+config::config() : PsiType(0), MaxPsiDouble(0), PsiMaxNoUp(0), PsiMaxNoDown(0), MaxMinStopStep(1), InitMaxMinStopStep(1), ProcPEGamma(8), ProcPEPsi(1), configpath(NULL),
+    configname(NULL), FastParsing(false), Deltat(0.01), basis(""), databasepath(NULL), DoConstrainedMD(0), MaxOuterStep(0), Thermostat(4), ThermostatImplemented(NULL),
+    ThermostatNames(NULL), TempFrequency(2.5), alpha(0.), HooverMass(0.), TargetTemp(0.00095004455), ScaleTempStep(25),  mainname(NULL), defaultpath(NULL), pseudopotpath(NULL),
+    DoOutVis(0), DoOutMes(1), DoOutNICS(0), DoOutOrbitals(0), DoOutCurrent(0), DoFullCurrent(0), DoPerturbation(0), DoWannier(0), CommonWannier(0), SawtoothStart(0.01),
+    VectorPlane(0), VectorCut(0.), UseAddGramSch(1), Seed(1), OutVisStep(10), OutSrcStep(5), MaxPsiStep(0), EpsWannier(1e-7), MaxMinStep(100), RelEpsTotalEnergy(1e-7),
+    RelEpsKineticEnergy(1e-5), MaxMinGapStopStep(0), MaxInitMinStep(100), InitRelEpsTotalEnergy(1e-5), InitRelEpsKineticEnergy(1e-4), InitMaxMinGapStopStep(0), ECut(128.),
+    MaxLevel(5), RiemannTensor(0), LevRFactor(0), RiemannLevel(0), Lev0Factor(2), RTActualUse(0), AddPsis(0), RCut(20.), StructOpt(0), IsAngstroem(1), RelativeCoord(0),
+    MaxTypes(0) {
   mainname = Malloc<char>(MAXSTRINGSIZE,"config constructor: mainname");
   defaultpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: defaultpath");
@@ -176,12 +174,4 @@
   configpath = Malloc<char>(MAXSTRINGSIZE,"config constructor: configpath");
   configname = Malloc<char>(MAXSTRINGSIZE,"config constructor: configname");
-  ThermostatImplemented = Malloc<int>(MaxThermostats, "config constructor: *ThermostatImplemented");
-  ThermostatNames = Malloc<char*>(MaxThermostats, "config constructor: *ThermostatNames");
-  for (int j=0;j<MaxThermostats;j++)
-    ThermostatNames[j] = Malloc<char>(12, "config constructor: ThermostatNames[]");
-  Thermostat = 4;
-  alpha = 0.;
-  ScaleTempStep = 25;
-  TempFrequency = 2.5;
   strcpy(mainname,"pcp");
   strcpy(defaultpath,"not specified");
@@ -191,78 +181,6 @@
   basis = "3-21G";
 
-  strcpy(ThermostatNames[0],"None");
-  ThermostatImplemented[0] = 1;
-  strcpy(ThermostatNames[1],"Woodcock"); 
-  ThermostatImplemented[1] = 1;
-  strcpy(ThermostatNames[2],"Gaussian"); 
-  ThermostatImplemented[2] = 1;
-  strcpy(ThermostatNames[3],"Langevin"); 
-  ThermostatImplemented[3] = 1;
-  strcpy(ThermostatNames[4],"Berendsen"); 
-  ThermostatImplemented[4] = 1;
-  strcpy(ThermostatNames[5],"NoseHoover"); 
-  ThermostatImplemented[5] = 1;
-
-  FastParsing = false;
-  ProcPEGamma=8;
-  ProcPEPsi=1;
-  DoOutVis=0;
-  DoOutMes=1;
-  DoOutNICS=0;
-  DoOutOrbitals=0;
-  DoOutCurrent=0;
-  DoPerturbation=0;
-  DoFullCurrent=0;
-  DoWannier=0;
-  DoConstrainedMD=0;
-  CommonWannier=0;
-  SawtoothStart=0.01;
-  VectorPlane=0;
-  VectorCut=0;
-  UseAddGramSch=1;
-  Seed=1;
-
-  MaxOuterStep=0;
-  Deltat=0.01;
-  OutVisStep=10;
-  OutSrcStep=5;
-  TargetTemp=0.00095004455;
-  ScaleTempStep=25;
-  MaxPsiStep=0;
-  EpsWannier=1e-7;
-
-  MaxMinStep=100;
-  RelEpsTotalEnergy=1e-7;
-  RelEpsKineticEnergy=1e-5;
-  MaxMinStopStep=1;
-  MaxMinGapStopStep=0;
-  MaxInitMinStep=100;
-  InitRelEpsTotalEnergy=1e-5;
-  InitRelEpsKineticEnergy=1e-4;
-  InitMaxMinStopStep=1;
-  InitMaxMinGapStopStep=0;
-
-  //BoxLength[NDIM*NDIM];
-
-  ECut=128.;
-  MaxLevel=5;
-  RiemannTensor=0;
-  LevRFactor=0;
-  RiemannLevel=0;
-  Lev0Factor=2;
-  RTActualUse=0;
-  PsiType=0;
-  MaxPsiDouble=0;
-  PsiMaxNoUp=0;
-  PsiMaxNoDown=0;
-  AddPsis=0;
-
-  RCut=20.;
-  StructOpt=0;
-  IsAngstroem=1;
-  RelativeCoord=0;
-  MaxTypes=0;
+  InitThermostats();
 };
-
 
 /** Destructor for config file class.
@@ -282,11 +200,34 @@
 };
 
+/** Initialises variables in class config for Thermostats.
+ */
+void config::InitThermostats()
+{
+  ThermostatImplemented = Malloc<int>(MaxThermostats, "config constructor: *ThermostatImplemented");
+  ThermostatNames = Malloc<char*>(MaxThermostats, "config constructor: *ThermostatNames");
+  for (int j=0;j<MaxThermostats;j++)
+    ThermostatNames[j] = Malloc<char>(12, "config constructor: ThermostatNames[]");
+
+  strcpy(ThermostatNames[0],"None");
+  ThermostatImplemented[0] = 1;
+  strcpy(ThermostatNames[1],"Woodcock");
+  ThermostatImplemented[1] = 1;
+  strcpy(ThermostatNames[2],"Gaussian");
+  ThermostatImplemented[2] = 1;
+  strcpy(ThermostatNames[3],"Langevin");
+  ThermostatImplemented[3] = 1;
+  strcpy(ThermostatNames[4],"Berendsen");
+  ThermostatImplemented[4] = 1;
+  strcpy(ThermostatNames[5],"NoseHoover");
+  ThermostatImplemented[5] = 1;
+};
+
 /** Readin of Thermostat related values from parameter file.
  * \param *fb file buffer containing the config file
  */
-void config::InitThermostats(class ConfigFileBuffer *fb)
+void config::ParseThermostats(class ConfigFileBuffer * const fb)
 {
-  char *thermo = Malloc<char>(12, "IonsInitRead: thermo");
-  int verbose = 0;
+  char * const thermo = Malloc<char>(12, "IonsInitRead: thermo");
+  const int verbose = 0;
 
   // read desired Thermostat from file along with needed additional parameters
@@ -354,5 +295,5 @@
     Thermostat = None;
   }
-  Free(&thermo);
+  Free(thermo);
 };
 
@@ -627,5 +568,5 @@
  * \return 0 - old syntax, 1 - new syntax, -1 - unknown syntax
  */
-int config::TestSyntax(char *filename, periodentafel *periode, molecule *mol)
+int config::TestSyntax(const char * const filename, const periodentafel * const periode, const molecule * const mol) const
 {
   int test;
@@ -666,5 +607,5 @@
  * \return *defaultpath
  */
-void config::SetDefaultPath(const char *path)
+void config::SetDefaultPath(const char * const path)
 {
   strcpy(defaultpath, path);
@@ -674,5 +615,5 @@
  * \param filename config file string
  */
-void config::RetrieveConfigPathAndName(string filename)
+void config::RetrieveConfigPathAndName(const string filename)
 {
   char *ptr = NULL;
@@ -702,5 +643,5 @@
  * \param *FileBuffer pointer to FileBuffer on return, should point to NULL
  */
-void PrepareFileBuffer(char *filename, struct ConfigFileBuffer *&FileBuffer)
+void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer)
 {
   if (FileBuffer != NULL) {
@@ -719,5 +660,5 @@
  * \param FastParsing whether to parse trajectories or not
  */
-void LoadMolecule(molecule *&mol, struct ConfigFileBuffer *&FileBuffer, periodentafel *periode, bool FastParsing)
+void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing)
 {
   int MaxTypes = 0;
@@ -893,5 +834,5 @@
  * \param *mol pointer to molecule containing all atoms of the molecule
  */
-void config::Load(char *filename, periodentafel *periode, molecule *mol)
+void config::Load(const char * const filename, const periodentafel * const periode, molecule * const &mol)
 {
   ifstream *file = new ifstream(filename);
@@ -909,5 +850,5 @@
 
   /* Oeffne Hauptparameterdatei */
-  int di;
+  int di = 0;
   double BoxLength[9];
   string zeile;
@@ -915,5 +856,5 @@
   int verbose = 0;
   
-  InitThermostats(FileBuffer);
+  ParseThermostats(FileBuffer);
   
   /* Namen einlesen */
@@ -1109,5 +1050,5 @@
  * \param *mol pointer to molecule containing all atoms of the molecule
  */
-void config::LoadOld(char *filename, periodentafel *periode, molecule *mol)
+void config::LoadOld(const char * const filename, const periodentafel * const periode, molecule * const &mol)
 {
   ifstream *file = new ifstream(filename);
@@ -1120,11 +1061,17 @@
 
   /* Oeffne Hauptparameterdatei */
-  int l, i, di;
-  double a,b;
+  int l = 0;
+  int i = 0;
+  int di = 0;
+  double a = 0.;
+  double b = 0.;
   double BoxLength[9];
   string zeile;
   string dummy;
   element *elementhash[128];
-  int Z, No, AtomNo, found;
+  int Z = -1;
+  int No = -1;
+  int AtomNo = -1;
+  int found = 0;
   int verbose = 0;
 
@@ -1313,11 +1260,10 @@
  * \param *mol pointer to molecule containing all atoms of the molecule
  */
-bool config::Save(const char *filename, periodentafel *periode, molecule *mol) const
+bool config::Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const
 {
   bool result = true;
   // bring MaxTypes up to date
   mol->CountElements();
-  ofstream *output = NULL;
-  output = new ofstream(filename, ios::out);
+  ofstream * const output = new ofstream(filename, ios::out);
   if (output != NULL) {
     *output << "# ParallelCarParinello - main configuration file - created with molecuilder" << endl;
@@ -1443,81 +1389,84 @@
  * \param *mol pointer to molecule containing all atoms of the molecule
  */
-bool config::SaveMPQC(const char *filename, molecule *mol) const
+bool config::SaveMPQC(const char * const filename, const molecule * const mol) const
 {
-  int AtomNo;
+  int AtomNo = -1;
   Vector *center = NULL;
   ofstream *output = NULL;
-  stringstream *fname = NULL;
 
   // first without hessian
-  fname = new stringstream;
-  *fname << filename << ".in";
-  output = new ofstream(fname->str().c_str(), ios::out);
-  *output << "% Created by MoleCuilder" << endl;
-  *output << "mpqc: (" << endl;
-  *output << "\tsavestate = no" << endl;
-  *output << "\tdo_gradient = yes" << endl;
-  *output << "\tmole<MBPT2>: (" << endl;
-  *output << "\t\tmaxiter = 200" << endl;
-  *output << "\t\tbasis = $:basis" << endl;
-  *output << "\t\tmolecule = $:molecule" << endl;
-  *output << "\t\treference<CLHF>: (" << endl;
-  *output << "\t\t\tbasis = $:basis" << endl;
-  *output << "\t\t\tmolecule = $:molecule" << endl;
-  *output << "\t\t)" << endl;
-  *output << "\t)" << endl;
-  *output << ")" << endl;
-  *output << "molecule<Molecule>: (" << endl;
-  *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
-  *output << "\t{ atoms geometry } = {" << endl;
-  center = mol->DetermineCenterOfAll(output);
-  // output of atoms
-  AtomNo = 0;
-  mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
-  delete(center);
-  *output << "\t}" << endl;
-  *output << ")" << endl;
-  *output << "basis<GaussianBasisSet>: (" << endl;
-  *output << "\tname = \"" << basis << "\"" << endl;
-  *output << "\tmolecule = $:molecule" << endl;
-  *output << ")" << endl;
-  output->close();
-  delete(output);
-  delete(fname);
+  {
+    stringstream * const fname = new stringstream;;
+    *fname << filename << ".in";
+    output = new ofstream(fname->str().c_str(), ios::out);
+    *output << "% Created by MoleCuilder" << endl;
+    *output << "mpqc: (" << endl;
+    *output << "\tsavestate = no" << endl;
+    *output << "\tdo_gradient = yes" << endl;
+    *output << "\tmole<MBPT2>: (" << endl;
+    *output << "\t\tmaxiter = 200" << endl;
+    *output << "\t\tbasis = $:basis" << endl;
+    *output << "\t\tmolecule = $:molecule" << endl;
+    *output << "\t\treference<CLHF>: (" << endl;
+    *output << "\t\t\tbasis = $:basis" << endl;
+    *output << "\t\t\tmolecule = $:molecule" << endl;
+    *output << "\t\t)" << endl;
+    *output << "\t)" << endl;
+    *output << ")" << endl;
+    *output << "molecule<Molecule>: (" << endl;
+    *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
+    *output << "\t{ atoms geometry } = {" << endl;
+    center = mol->DetermineCenterOfAll(output);
+    // output of atoms
+    AtomNo = 0;
+    mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
+    delete(center);
+    *output << "\t}" << endl;
+    *output << ")" << endl;
+    *output << "basis<GaussianBasisSet>: (" << endl;
+    *output << "\tname = \"" << basis << "\"" << endl;
+    *output << "\tmolecule = $:molecule" << endl;
+    *output << ")" << endl;
+    output->close();
+    delete(output);
+    delete(fname);
+  }
 
   // second with hessian
-  fname = new stringstream;
-  *fname << filename << ".hess.in";
-  output = new ofstream(fname->str().c_str(), ios::out);
-  *output << "% Created by MoleCuilder" << endl;
-  *output << "mpqc: (" << endl;
-  *output << "\tsavestate = no" << endl;
-  *output << "\tdo_gradient = yes" << endl;
-  *output << "\tmole<CLHF>: (" << endl;
-  *output << "\t\tmaxiter = 200" << endl;
-  *output << "\t\tbasis = $:basis" << endl;
-  *output << "\t\tmolecule = $:molecule" << endl;
-  *output << "\t)" << endl;
-  *output << "\tfreq<MolecularFrequencies>: (" << endl;
-  *output << "\t\tmolecule=$:molecule" << endl;
-  *output << "\t)" << endl;
-  *output << ")" << endl;
-  *output << "molecule<Molecule>: (" << endl;
-  *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
-  *output << "\t{ atoms geometry } = {" << endl;
-  center = mol->DetermineCenterOfAll(output);
-  // output of atoms
-  AtomNo = 0;
-  mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
-  delete(center);
-  *output << "\t}" << endl;
-  *output << ")" << endl;
-  *output << "basis<GaussianBasisSet>: (" << endl;
-  *output << "\tname = \"3-21G\"" << endl;
-  *output << "\tmolecule = $:molecule" << endl;
-  *output << ")" << endl;
-  output->close();
-  delete(output);
-  delete(fname);
+  {
+    stringstream * const fname = new stringstream;
+    *fname << filename << ".hess.in";
+    output = new ofstream(fname->str().c_str(), ios::out);
+    *output << "% Created by MoleCuilder" << endl;
+    *output << "mpqc: (" << endl;
+    *output << "\tsavestate = no" << endl;
+    *output << "\tdo_gradient = yes" << endl;
+    *output << "\tmole<CLHF>: (" << endl;
+    *output << "\t\tmaxiter = 200" << endl;
+    *output << "\t\tbasis = $:basis" << endl;
+    *output << "\t\tmolecule = $:molecule" << endl;
+    *output << "\t)" << endl;
+    *output << "\tfreq<MolecularFrequencies>: (" << endl;
+    *output << "\t\tmolecule=$:molecule" << endl;
+    *output << "\t)" << endl;
+    *output << ")" << endl;
+    *output << "molecule<Molecule>: (" << endl;
+    *output << "\tunit = " << (IsAngstroem ? "angstrom" : "bohr" ) << endl;
+    *output << "\t{ atoms geometry } = {" << endl;
+    center = mol->DetermineCenterOfAll(output);
+    // output of atoms
+    AtomNo = 0;
+    mol->ActOnAllAtoms( &atom::OutputMPQCLine, output, (const Vector *)center, &AtomNo );
+    delete(center);
+    *output << "\t}" << endl;
+    *output << ")" << endl;
+    *output << "basis<GaussianBasisSet>: (" << endl;
+    *output << "\tname = \"3-21G\"" << endl;
+    *output << "\tmolecule = $:molecule" << endl;
+    *output << ")" << endl;
+    output->close();
+    delete(output);
+    delete(fname);
+  }
 
   return true;
@@ -1545,10 +1494,14 @@
  * \note Routine is taken from the pcp project and hack-a-slack adapted to C++
  */
-int ParseForParameter(int verbose, ifstream *file, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical) {
-  int i,j;  // loop variables
-  int length = 0, maxlength = -1;
+int ParseForParameter(const int verbose, ifstream * const file, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical) {
+  int i = 0;
+  int j = 0;  // loop variables
+  int length = 0;
+  int maxlength = -1;
   long file_position = file->tellg(); // mark current position
-  char *dummy1, *dummy, *free_dummy;    // pointers in the line that is read in per step
-  dummy1 = free_dummy = Malloc<char>(256, "config::ParseForParameter: *free_dummy");
+  char *dummy1 = NULL;
+  char *dummy = NULL;
+  char * const free_dummy = Malloc<char>(256, "config::ParseForParameter: *free_dummy");    // pointers in the line that is read in per step
+  dummy1 = free_dummy;
 
   //fprintf(stderr,"Parsing for %s\n",name);
@@ -1565,5 +1518,5 @@
       if (file->eof()) {
         if ((critical) && (found == 0)) {
-          Free(&free_dummy);
+          Free(free_dummy);
           //Error(InitReading, name);
           fprintf(stderr,"Error:InitReading, critical %s not found\n", name);
@@ -1573,5 +1526,5 @@
           file->clear();
           file->seekg(file_position, ios::beg);  // rewind to start position
-          Free(&free_dummy);
+          Free(free_dummy);
           return 0;
         }
@@ -1625,5 +1578,5 @@
               if (file->eof()) {
                 if ((critical) && (found == 0)) {
-                  Free(&free_dummy);
+                  Free(free_dummy);
                   //Error(InitReading, name);
                   fprintf(stderr,"Error:InitReading, critical %s not found\n", name);
@@ -1633,5 +1586,5 @@
                   file->clear();
                   file->seekg(file_position, ios::beg);  // rewind to start position
-                  Free(&free_dummy);
+                  Free(free_dummy);
                   return 0;
                 }
@@ -1674,5 +1627,5 @@
                   if (critical) {
                     if (verbose) fprintf(stderr,"Error: EoL at %i and still missing %i value(s) for parameter %s\n", line, yth-j, name);
-                    Free(&free_dummy);
+                    Free(free_dummy);
                     //return 0;
                     exit(255);
@@ -1682,5 +1635,5 @@
                     file->clear();
                     file->seekg(file_position, ios::beg);  // rewind to start position
-                    Free(&free_dummy);
+                    Free(free_dummy);
                     return 0;
                   }
@@ -1695,5 +1648,5 @@
                   file->seekg(file_position, ios::beg);  // rewind to start position
                 }
-                Free(&free_dummy);
+                Free(free_dummy);
                 return 0;
               }
@@ -1751,5 +1704,5 @@
   if ((type >= row_int) && (verbose))
     fprintf(stderr,"\n");
-  Free(&free_dummy);
+  Free(free_dummy);
   if (!sequential) {
     file->clear();
@@ -1783,9 +1736,12 @@
  * \note Routine is taken from the pcp project and hack-a-slack adapted to C++
  */
-int ParseForParameter(int verbose, struct ConfigFileBuffer *FileBuffer, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical) {
-  int i,j;  // loop variables
-  int length = 0, maxlength = -1;
+int ParseForParameter(const int verbose, struct ConfigFileBuffer * const FileBuffer, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical) {
+  int i = 0;
+  int j = 0;  // loop variables
+  int length = 0;
+  int maxlength = -1;
   int OldCurrentLine = FileBuffer->CurrentLine;
-  char *dummy1, *dummy;    // pointers in the line that is read in per step
+  char *dummy1 = NULL;
+  char *dummy = NULL;    // pointers in the line that is read in per step
 
   //fprintf(stderr,"Parsing for %s\n",name);
Index: src/config.hpp
===================================================================
--- src/config.hpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/config.hpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -35,9 +35,9 @@
 
     ConfigFileBuffer();
-    ConfigFileBuffer(char *filename);
+    ConfigFileBuffer(const char * const filename);
     ~ConfigFileBuffer();
 
     void InitMapping();
-    void MapIonTypesInBuffer(int NoAtoms);
+    void MapIonTypesInBuffer(const int NoAtoms);
 };
 
@@ -130,21 +130,22 @@
   ~config();
 
-  int TestSyntax(char *filename, periodentafel *periode, molecule *mol);
-  void Load(char *filename, periodentafel *periode, molecule *mol);
-  void LoadOld(char *filename, periodentafel *periode, molecule *mol);
-  void RetrieveConfigPathAndName(string filename);
-  bool Save(const char *filename, periodentafel *periode, molecule *mol) const;
-  bool SaveMPQC(const char *filename, molecule *mol) const;
+  int TestSyntax(const char * const filename, const periodentafel * const periode, const molecule * const mol) const;
+  void Load(const char * const filename, const periodentafel * const periode, molecule * const &mol);
+  void LoadOld(const char * const filename, const periodentafel * const periode, molecule * const &mol);
+  void RetrieveConfigPathAndName(const string filename);
+  bool Save(const char * const filename, const periodentafel * const periode, molecule * const mol) const;
+  bool SaveMPQC(const char * const filename, const molecule * const mol) const;
   void Edit();
   bool GetIsAngstroem() const;
   char *GetDefaultPath() const;
-  void SetDefaultPath(const char *path);
-  void InitThermostats(class ConfigFileBuffer *fb);
+  void SetDefaultPath(const char * const path);
+  void InitThermostats();
+  void ParseThermostats(class ConfigFileBuffer * const fb);
 };
 
-int ParseForParameter(int verbose, ifstream *file, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);
-int ParseForParameter(int verbose, struct ConfigFileBuffer *FileBuffer, const char *name, int sequential, int const xth, int const yth, int type, void *value, int repetition, int critical);
-void LoadMolecule(molecule *&mol, struct ConfigFileBuffer *&FileBuffer, periodentafel *periode, bool FastParsing);
-void PrepareFileBuffer(char *filename, struct ConfigFileBuffer *&FileBuffer);
+int ParseForParameter(const int verbose, ifstream * const file, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical);
+int ParseForParameter(const int verbose, struct ConfigFileBuffer * const FileBuffer, const char * const name, const int sequential, const int xth, const int yth, const int type, void * value, const int repetition, const int critical);
+void LoadMolecule(molecule * const &mol, struct ConfigFileBuffer * const &FileBuffer, const periodentafel * const periode, const bool FastParsing);
+void PrepareFileBuffer(const char * const filename, struct ConfigFileBuffer *&FileBuffer);
 
 #endif /* CONFIG_HPP_ */
Index: src/memoryallocator.hpp
===================================================================
--- src/memoryallocator.hpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/memoryallocator.hpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -105,7 +105,7 @@
 };
 
-/** Frees allocated memory range using free().
+/** Frees allocated memory range using free(), NULL'ing \a **buffer.
  *
- * \param pointer to the allocated memory range to free; may be NULL, this function is a no-op then
+ * \param **buffer to the allocated memory range to free; may be NULL, this function is a no-op then
  * \param *msg optional error message
  */
@@ -120,3 +120,17 @@
 };
 
+/** Frees allocated memory range using free() for ... * const \a buffer types.
+ *
+ * \param *buffer to the allocated memory range to free; may be NULL, this function is a no-op then
+ * \param *msg optional error message
+ */
+template <typename X> void Free(X* const buffer, const char *msg = NULL)
+{
+  if ((buffer == NULL))
+    return;
+
+  MemoryUsageObserver::getInstance()->removeMemory(buffer, msg);
+  free(buffer);
+};
+
 #endif /*MEMORYALLOCATOR_HPP_*/
Index: src/periodentafel.cpp
===================================================================
--- src/periodentafel.cpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/periodentafel.cpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -21,8 +21,6 @@
  * Initialises start and end of list and resets periodentafel::checkliste to false.
  */
-periodentafel::periodentafel()
-{
-  start = new element;
-  end = new element;
+periodentafel::periodentafel() : start(new element), end(new element)
+{
   start->previous = NULL;
   start->next = end;
@@ -45,5 +43,5 @@
  * \return true - succeeded, false - does not occur
  */
-bool periodentafel::AddElement(element *pointer)
+bool periodentafel::AddElement(element * const pointer)
 {
   pointer->sort = &pointer->Z;
@@ -57,5 +55,5 @@
  * \return true - succeeded, false - element not found
  */
-bool periodentafel::RemoveElement(element *pointer)
+bool periodentafel::RemoveElement(element * const pointer)
 {
   return remove(pointer, start, end);
@@ -71,24 +69,11 @@
 
 /** Finds an element by its atomic number.
- * If element is not yet in list, datas are asked and stored in database.
+ * If element is not yet in list, returns NULL.
  * \param Z atomic number
- * \return pointer to element
- */
-element * periodentafel::FindElement(int Z)
+ * \return pointer to element or NULL if not found
+ */
+element * const periodentafel::FindElement(const int Z) const
 {
   element *walker = find(&Z, start,end);
-  if (walker == NULL) { // not found: enter and put into db
-    cout << Verbose(0) << "Element not found in database, please enter." << endl;
-    walker = new element;
-    cout << Verbose(0) << "Mass: " << endl;
-    cin >> walker->mass;
-    walker->Z = Z;
-    cout << Verbose(0) << "Atomic number: " << walker->Z << endl;
-    cout << Verbose(0) << "Name [max 64 chars]: " << endl;
-    cin >> walker->name;
-    cout << Verbose(0) << "Short form [max 3 chars]: " << endl;
-    cin >> walker->symbol;
-    periodentafel::AddElement(walker);
-  }
   return(walker);
 };
@@ -99,5 +84,5 @@
  * \return pointer to element
  */
-element * periodentafel::FindElement(const char *shorthand) const
+element * const periodentafel::FindElement(const char * const shorthand) const
 {
   element *walker =  periodentafel::start;
@@ -112,5 +97,5 @@
 /** Asks for element number and returns pointer to element
  */
-element * periodentafel::AskElement()
+element * const periodentafel::AskElement() const
 {
   element *walker = NULL;
@@ -124,8 +109,33 @@
 };
 
+/** Asks for element and if not found, presents mask to enter info.
+ * \return pointer to either present or newly created element
+ */
+element * const periodentafel::EnterElement()
+{
+  element *walker = NULL;
+  int Z = -1;
+  cout << Verbose(0) << "Atomic number: " << Z << endl;
+  cin >> Z;
+  walker = FindElement(Z);
+  if (walker == NULL) {
+    cout << Verbose(0) << "Element not found in database, please enter." << endl;
+    walker = new element;
+    walker->Z = Z;
+    cout << Verbose(0) << "Mass: " << endl;
+    cin >> walker->mass;
+    cout << Verbose(0) << "Name [max 64 chars]: " << endl;
+    cin >> walker->name;
+    cout << Verbose(0) << "Short form [max 3 chars]: " << endl;
+    cin >> walker->symbol;
+    periodentafel::AddElement(walker);
+  }
+  return(walker);
+};
+
 /** Prints period table to given stream.
  * \param output stream
  */
-bool periodentafel::Output(ofstream *output) const
+bool periodentafel::Output(ofstream * const output) const
 {
   bool result = true;
@@ -145,5 +155,5 @@
  * \param *checkliste elements table for this molecule
  */
-bool periodentafel::Checkout(ofstream *output, const int *checkliste) const
+bool periodentafel::Checkout(ofstream * const output, const int * const checkliste) const
 {
   element *walker = start;
Index: src/periodentafel.hpp
===================================================================
--- src/periodentafel.hpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/periodentafel.hpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -34,14 +34,15 @@
   ~periodentafel();
 
-  bool AddElement(element *pointer);
-  bool RemoveElement(element *pointer);
+  bool AddElement(element * const pointer);
+  bool RemoveElement(element * const pointer);
   bool CleanupPeriodtable();
-  element * FindElement(int Z);
-  element * FindElement(const char *shorthand) const;
-  element * AskElement();
-  bool Output(ofstream *output) const;
-  bool Checkout(ofstream *output, const int *checkliste) const;
-  bool LoadPeriodentafel(const char *path);
-  bool StorePeriodentafel(const char *path) const;
+  element * const FindElement(const int Z) const;
+  element * const FindElement(const char * const shorthand) const;
+  element * const AskElement() const;
+  element * const EnterElement();
+  bool Output(ofstream * const output) const;
+  bool Checkout(ofstream * const output, const int * const checkliste) const;
+  bool LoadPeriodentafel(const char * const path);
+  bool StorePeriodentafel(const char * const path) const;
 
   private:
Index: src/vector.hpp
===================================================================
--- src/vector.hpp	(revision 776b64559ecd2f9ada1f26f55c897028165fb398)
+++ src/vector.hpp	(revision fb73b8313dc69e341d7e560e1f298f5da5c56b22)
@@ -27,5 +27,5 @@
 
   Vector();
-  Vector(double x1, double x2, double x3);
+  Vector(const double x1, const double x2, const double x3);
   ~Vector();
 
