Index: src/bondgraph.cpp
===================================================================
--- src/bondgraph.cpp	(revision e08c46a527abafdd358c8cd066c13f33e9b77ab1)
+++ src/bondgraph.cpp	(revision bd6bfac107ab7ca8d1788ff529d3fa4c3a27439f)
@@ -88,5 +88,5 @@
 {
   Info FunctionInfo(__func__);
-bool status = true;
+  bool status = true;
 
   if (mol->empty()) // only construct if molecule is not empty
Index: src/molecule.hpp
===================================================================
--- src/molecule.hpp	(revision e08c46a527abafdd358c8cd066c13f33e9b77ab1)
+++ src/molecule.hpp	(revision bd6bfac107ab7ca8d1788ff529d3fa4c3a27439f)
@@ -380,4 +380,5 @@
   bool StoreForcesFile(char *path, int *SortIndex);
   void insert(molecule *mol);
+  void erase(molecule *mol);
   molecule * ReturnIndex(int index);
   bool OutputConfigForListOfFragments(config *configuration, int *SortIndex);
Index: src/molecule_graph.cpp
===================================================================
--- src/molecule_graph.cpp	(revision e08c46a527abafdd358c8cd066c13f33e9b77ab1)
+++ src/molecule_graph.cpp	(revision bd6bfac107ab7ca8d1788ff529d3fa4c3a27439f)
@@ -67,4 +67,5 @@
     performCriticalExit();
   };
+  doCountAtoms();
 
   // skip header
@@ -632,5 +633,5 @@
   DoLog(1) && (Log() << Verbose(1) << "Final graph info for each bond is:" << endl);
   for(molecule::const_iterator AtomRunner = begin(); AtomRunner != end(); ++AtomRunner)
-    for(BondList::const_iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
+    for(BondList::const_iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); BondRunner != (*AtomRunner)->ListOfBonds.end(); ++BondRunner)
       if ((*BondRunner)->leftatom == *AtomRunner) {
         Binder = *BondRunner;
Index: src/moleculelist.cpp
===================================================================
--- src/moleculelist.cpp	(revision e08c46a527abafdd358c8cd066c13f33e9b77ab1)
+++ src/moleculelist.cpp	(revision bd6bfac107ab7ca8d1788ff529d3fa4c3a27439f)
@@ -40,10 +40,7 @@
 MoleculeListClass::~MoleculeListClass()
 {
-  DoLog(3) && (Log() << Verbose(3) << this << ": Freeing ListOfMolcules." << endl);
-  for (MoleculeList::iterator ListRunner = ListOfMolecules.begin(); ListRunner != ListOfMolecules.end(); ListRunner++) {
-    DoLog(4) && (Log() << Verbose(4) << "ListOfMolecules: Freeing " << *ListRunner << "." << endl);
-    world->destroyMolecule(*ListRunner);
-  }
-  DoLog(4) && (Log() << Verbose(4) << "Freeing ListOfMolecules." << endl);
+  DoLog(4) && (Log() << Verbose(4) << "Clearing ListOfMolecules." << endl);
+  for(MoleculeList::iterator MolRunner = ListOfMolecules.begin(); MolRunner != ListOfMolecules.end(); ++MolRunner)
+    (*MolRunner)->signOff(this);
   ListOfMolecules.clear(); // empty list
 };
@@ -51,5 +48,4 @@
 /** Insert a new molecule into the list and set its number.
  * \param *mol molecule to add to list.
- * \return true - add successful
  */
 void MoleculeListClass::insert(molecule *mol)
@@ -59,4 +55,14 @@
   ListOfMolecules.push_back(mol);
   mol->signOn(this);
+};
+
+/** Erases a molecule from the list.
+ * \param *mol molecule to add to list.
+ */
+void MoleculeListClass::erase(molecule *mol)
+{
+  OBSERVE;
+  mol->signOff(this);
+  ListOfMolecules.remove(mol);
 };
 
@@ -742,22 +748,17 @@
 void MoleculeListClass::DissectMoleculeIntoConnectedSubgraphs(const periodentafel * const periode, config * const configuration)
 {
+  // 0a. remove all present molecules
+  vector<molecule *> allmolecules = World::getInstance().getAllMolecules();
+  for (vector<molecule *>::iterator MolRunner = allmolecules.begin(); MolRunner != allmolecules.end(); ++MolRunner) {
+    erase(*MolRunner);
+    World::getInstance().destroyMolecule(*MolRunner);
+  }
+  // 0b. remove all bonds
   molecule *mol = World::getInstance().createMolecule();
-  bond *Binder = NULL;
-  // 0. gather all atoms into single molecule
-  for (MoleculeList::iterator MolRunner = ListOfMolecules.begin(); !ListOfMolecules.empty(); MolRunner = ListOfMolecules.begin()) {
-    // shift all atoms to new molecule
-    for (molecule::iterator iter = (*MolRunner)->begin(); (*MolRunner)->empty(); iter = (*MolRunner)->begin()) {
-      DoLog(3) && (Log() << Verbose(3) << "Re-linking " << (*iter) << "..." << endl);
-      (*iter)->father = (*iter);
-      mol->AddAtom((*iter));    // counting starts at 1
-      (*MolRunner)->erase(iter);
-    }
-    // remove all bonds
-    for(molecule::iterator AtomRunner = (*MolRunner)->begin(); AtomRunner != (*MolRunner)->end(); ++AtomRunner)
-      for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
-        delete(*BondRunner);
-    // remove the molecule
-    World::getInstance().destroyMolecule(*MolRunner);
-    ListOfMolecules.erase(MolRunner);
+  vector <atom *> allatoms = World::getInstance().getAllAtoms();
+  for(vector<atom *>::iterator AtomRunner = allatoms.begin(); AtomRunner != allatoms.end(); ++AtomRunner) {
+    for(BondList::iterator BondRunner = (*AtomRunner)->ListOfBonds.begin(); !(*AtomRunner)->ListOfBonds.empty(); BondRunner = (*AtomRunner)->ListOfBonds.begin())
+      delete(*BondRunner);
+    mol->AddAtom(*AtomRunner);
   }
 
@@ -816,12 +817,13 @@
   // 4c. relocate atoms to new molecules and remove from Leafs
   for (molecule::iterator iter = mol->begin(); !mol->empty(); iter = mol->begin()) {
-    if (((*iter)->nr <0) || ((*iter)->nr >= mol->getAtomCount())) {
-      DoeLog(0) && (eLog()<< Verbose(0) << "Index of atom " << **iter << " is invalid!" << endl);
+    const int count = mol->getAtomCount();
+    if (((*iter)->nr <0) || ((*iter)->nr >= count)) {
+      DoeLog(0) && (eLog()<< Verbose(0) << "Index " << (*iter)->nr << " of atom " << **iter << " in molecule of " << count << " atoms is invalid!" << endl);
       performCriticalExit();
     }
-    FragmentCounter = MolMap[(*iter)->nr];
-    if (FragmentCounter != 0) {
+    const int Index = MolMap[(*iter)->nr];
+    if (Index != 0) {
       DoLog(3) && (Log() << Verbose(3) << "Re-linking " << **iter << "..." << endl);
-      molecules[FragmentCounter-1]->AddAtom((*iter));    // counting starts at 1
+      molecules[Index-1]->AddAtom((*iter));    // counting starts at 1
       mol->erase(iter);
     } else {
