Index: src/Actions/AtomAction/ChangeElementAction.cpp
===================================================================
--- src/Actions/AtomAction/ChangeElementAction.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Actions/AtomAction/ChangeElementAction.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -70,8 +70,5 @@
     first = iter->second;
     LOG(1, "Changing atom " << *first << " to element " << *params.elemental.get() << ".");
-    mol = first->getMolecule();
-    first->removeFromMolecule(); // remove atom
     first->setType(params.elemental.get());
-    mol->AddAtom(first);  // add atom to ensure correctness of formula
   }
   return ActionState::ptr(UndoState);
@@ -85,8 +82,5 @@
   for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
     first = World::getInstance().getAtom(AtomById(iter->first));
-    mol = first->getMolecule();
-    first->removeFromMolecule(); // remove atom
     first->setType(iter->second);
-    mol->AddAtom(first);  // add atom to ensure correctness of formula
   }
 
@@ -101,8 +95,5 @@
   for(ElementMap::const_iterator iter = state->Elements.begin(); iter != state->Elements.end(); ++iter) {
     first = World::getInstance().getAtom(AtomById(iter->first));
-    mol = first->getMolecule();
-    first->removeFromMolecule(); // remove atom
     first->setType(state->params.elemental.get());
-    mol->AddAtom(first);  // add atom to ensure correctness of formula
   }
 
Index: src/Actions/AtomAction/SaturateAction.cpp
===================================================================
--- src/Actions/AtomAction/SaturateAction.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Actions/AtomAction/SaturateAction.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -67,9 +67,13 @@
 
     // if atom is attached to molecule, add hydrogens there, too
-    molecule * mol = _atom->getMolecule();
-    if (mol == NULL) {
+    molecule * mol = NULL;
+    if (_atom->getMolecule() == NULL) {
       mol = World::getInstance().createMolecule();
       mol->AddAtom(_atom);
+    } else {
+      mol = World::getInstance().getMolecule(MoleculeById(_atom->getMolecule()->getId()));
     }
+    ASSERT( mol != NULL,
+        "ChangeElementAction::performCall() - mol is still NULL." );
 
     // add the hydrogens
Index: src/Actions/FragmentationAction/FragmentationAction.cpp
===================================================================
--- src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Actions/FragmentationAction/FragmentationAction.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -40,4 +40,5 @@
 #include "CodePatterns/Log.hpp"
 #include "Descriptors/AtomSelectionDescriptor.hpp"
+#include "Descriptors/MoleculeIdDescriptor.hpp"
 #include "Fragmentation/Exporters/ExportGraph_ToFiles.hpp"
 #include "Fragmentation/Exporters/ExportGraph_ToJobs.hpp"
@@ -95,5 +96,5 @@
 
   // go through all atoms, note down their molecules and group them
-  typedef std::multimap<molecule *, atom *> clusters_t;
+  typedef std::multimap<const molecule *, atom *> clusters_t;
   typedef std::vector<atomId_t> atomids_t;
   atomids_t atomids;
@@ -105,5 +106,5 @@
   }
   {
-    std::vector<molecule *> molecules;
+    std::vector<const molecule *> molecules;
     molecules.insert( molecules.end(), MapKeyIterator<clusters_t::const_iterator>(clusters.begin()),
         MapKeyIterator<clusters_t::const_iterator>(clusters.end()) );
@@ -149,5 +150,5 @@
       iter = advanceiter) {
     // get iterator to past last atom in this molecule
-    molecule * mol = iter->first;
+    const molecule * mol = iter->first;
     advanceiter = clusters.upper_bound(mol);
 
@@ -161,5 +162,6 @@
         << " atoms, out of " << mol->getAtomCount() << ".");
     const enum HydrogenTreatment treatment =  params.HowtoTreatHydrogen.get() ? ExcludeHydrogen : IncludeHydrogen;
-    Fragmentation Fragmenter(mol, *FileChecker, treatment);
+    molecule * non_const_mol = World::getInstance().getMolecule(MoleculeById(mol->getId()));
+    Fragmentation Fragmenter(non_const_mol, *FileChecker, treatment);
 
     // perform fragmentation
Index: src/Atom/CopyAtoms/CopyAtoms_withBonds.cpp
===================================================================
--- src/Atom/CopyAtoms/CopyAtoms_withBonds.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Atom/CopyAtoms/CopyAtoms_withBonds.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -42,4 +42,5 @@
 #include "CodePatterns/Assert.hpp"
 #include "CodePatterns/Log.hpp"
+#include "Descriptors/MoleculeIdDescriptor.hpp"
 #include "molecule.hpp"
 #include "WorldTime.hpp"
@@ -93,9 +94,10 @@
       original_iter != _atoms.end(); ++original_iter) {
     const atom * const _atom = *original_iter;
-    molecule * const mol = _atom->getMolecule();
+    const molecule * const mol = _atom->getMolecule();
     if (mol != NULL) {
       ASSERT( LookupMap.count(_atom),
           "CopyAtoms_withBonds::operator() - atom "+toString(_atom)+" not found in LookupMap.");
-      mol->AddAtom(LookupMap[_atom]);
+      molecule * non_const_mol = World::getInstance().getMolecule(MoleculeById(mol->getId()));
+      non_const_mol->AddAtom(LookupMap[_atom]);
     }
   }
Index: src/Atom/atom.cpp
===================================================================
--- src/Atom/atom.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Atom/atom.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -304,5 +304,5 @@
 }
 
-molecule* atom::getMolecule() const {
+const molecule* atom::getMolecule() const {
   return mol;
 }
Index: src/Atom/atom.hpp
===================================================================
--- src/Atom/atom.hpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Atom/atom.hpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -193,5 +193,5 @@
     * \return containing molecule
     */
-   molecule* getMolecule() const;
+   const molecule* getMolecule() const;
 
    /** Erases the atom in atom::mol's list of atoms and sets it to zero.
Index: src/Descriptors/MoleculeOfAtomSelectionDescriptor.cpp
===================================================================
--- src/Descriptors/MoleculeOfAtomSelectionDescriptor.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Descriptors/MoleculeOfAtomSelectionDescriptor.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -35,4 +35,5 @@
 #include "CodePatterns/MemDebug.hpp"
 
+#include "Descriptors/MoleculeIdDescriptor.hpp"
 #include "Descriptors/MoleculeOfAtomSelectionDescriptor.hpp"
 #include "Descriptors/MoleculeOfAtomSelectionDescriptor_impl.hpp"
@@ -62,6 +63,7 @@
       iter != set.end_internal();
       ++iter) {
-    if (iter->second->getMolecule())
-      return iter->second->getMolecule();
+    if (iter->second->getMolecule()) {
+      return World::getInstance().getMolecule(MoleculeById(iter->second->getMolecule()->getId()));
+    }
   }
   return 0;
@@ -77,7 +79,10 @@
       ++iter) {
     if (iter->second->getMolecule()) {
-      inserter = temp.insert( iter->second->getMolecule() );
+      molecule * const _mol =
+          World::getInstance().getMolecule(
+              MoleculeById(iter->second->getMolecule()->getId()));
+      inserter = temp.insert( _mol );
       if (inserter.second)
-        res.push_back(iter->second->getMolecule());
+        res.push_back(_mol);
     }
   }
Index: src/Fragmentation/Interfragmenter.cpp
===================================================================
--- src/Fragmentation/Interfragmenter.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/Fragmentation/Interfragmenter.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -103,5 +103,5 @@
     /// go through linked cell and get all neighboring atoms up to Rcut
     Vector center;
-    molecule *_mol = (*atoms.begin())->getMolecule();
+    const molecule *_mol = (*atoms.begin())->getMolecule();
     for (AtomIdSet::const_iterator iter = atoms.begin();
         iter != atoms.end(); ++iter) {
Index: src/World.cpp
===================================================================
--- src/World.cpp	(revision 9b3262b2e3b9296a0c5ea340ffa6b8b38a694615)
+++ src/World.cpp	(revision 270bdface47b2d970089daba2ed78dc3f90395a7)
@@ -360,5 +360,5 @@
   }
   // check if it's the last atom
-  molecule *_mol = atom->getMolecule();
+  molecule *_mol = const_cast<molecule *>(atom->getMolecule());
   if ((_mol == NULL) || (_mol->getAtomCount() > 1))
     _mol = NULL;
@@ -764,5 +764,5 @@
   NOTIFY(SelectionChanged);
   ASSERT(_atom,"Invalid atom pointer in selection of MoleculeOfAtom");
-  molecule *mol=_atom->getMolecule();
+  const molecule *mol=_atom->getMolecule();
   // the atom might not be part of a molecule
   if(mol){
@@ -805,5 +805,5 @@
   NOTIFY(SelectionChanged);
   ASSERT(_atom,"Invalid atom pointer in selection of MoleculeOfAtom");
-  molecule *mol=_atom->getMolecule();
+  const molecule *mol=_atom->getMolecule();
   // the atom might not be part of a molecule
   if(mol){
