Index: src/Actions/SelectionAction/Molecules/MoleculeByFormulaAction.cpp
===================================================================
--- src/Actions/SelectionAction/Molecules/MoleculeByFormulaAction.cpp	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/MoleculeByFormulaAction.cpp	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -56,7 +56,7 @@
 ActionState::ptr SelectionMoleculeByFormulaAction::performCall() {
   LOG(1, "Selecting molecules with chemical formula " << params.formula.get() << ":");
-//  std::vector<molecule *> matchingMolecules = World::getInstance().getAllMolecules(MoleculeByFormula(params.formula.get()));
-  std::vector<molecule *> selectedMolecules =
-      World::getInstance().getAllMolecules(MoleculesBySelection() && MoleculeByFormula(params.formula.get()));
+  std::vector<const molecule *> selectedMolecules =
+      const_cast<const World &>(World::getInstance()).
+      getAllMolecules(MoleculesBySelection() && MoleculeByFormula(params.formula.get()));
 //  BOOST_FOREACH(molecule *mol, matchingMolecules)
 //    LOG(1, "\t" << mol->getId() << ", " << mol->getName() << ".");
@@ -70,5 +70,5 @@
 
   World::getInstance().unselectAllMolecules(MoleculeByFormula(state->params.formula.get()));
-  BOOST_FOREACH( molecule *mol, state->selectedMolecules)
+  BOOST_FOREACH( const molecule *mol, state->selectedMolecules)
     World::getInstance().selectMolecule(mol);
 
Index: src/Actions/SelectionAction/Molecules/MoleculeByFormulaAction.def
===================================================================
--- src/Actions/SelectionAction/Molecules/MoleculeByFormulaAction.def	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/MoleculeByFormulaAction.def	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -22,5 +22,5 @@
 (FormulaValidator())
 
-#define statetypes (std::vector<molecule*>)
+#define statetypes (std::vector<const molecule*>)
 #define statereferences (selectedMolecules)
 
Index: src/Actions/SelectionAction/Molecules/MoleculeByNameAction.cpp
===================================================================
--- src/Actions/SelectionAction/Molecules/MoleculeByNameAction.cpp	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/MoleculeByNameAction.cpp	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -56,6 +56,7 @@
 ActionState::ptr SelectionMoleculeByNameAction::performCall() {
   LOG(1, "Selecting all molecules called " << params.molname.get());
-  std::vector<molecule *> selectedMolecules =
-      World::getInstance().getAllMolecules(MoleculesBySelection() && MoleculeByName(params.molname.get()));
+  std::vector<const molecule *> selectedMolecules =
+      const_cast<const World &>(World::getInstance()).
+      getAllMolecules(MoleculesBySelection() && MoleculeByName(params.molname.get()));
   World::getInstance().selectAllMolecules(MoleculeByName(params.molname.get()));
   LOG(0, World::getInstance().countSelectedMolecules() << " molecules selected.");
@@ -68,5 +69,5 @@
 
   World::getInstance().unselectAllMolecules(MoleculeByName(state->params.molname.get()));
-  BOOST_FOREACH( molecule *mol, state->selectedMolecules)
+  BOOST_FOREACH( const molecule *mol, state->selectedMolecules)
     World::getInstance().selectMolecule(mol);
 
Index: src/Actions/SelectionAction/Molecules/MoleculeByNameAction.def
===================================================================
--- src/Actions/SelectionAction/Molecules/MoleculeByNameAction.def	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/MoleculeByNameAction.def	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -24,5 +24,5 @@
 (DummyValidator< std::string >())
 
-#define statetypes (std::vector<molecule *>)
+#define statetypes (std::vector<const molecule *>)
 #define statereferences (selectedMolecules)
 
Index: src/Actions/SelectionAction/Molecules/NotMoleculeByFormulaAction.cpp
===================================================================
--- src/Actions/SelectionAction/Molecules/NotMoleculeByFormulaAction.cpp	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/NotMoleculeByFormulaAction.cpp	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -56,6 +56,10 @@
 ActionState::ptr SelectionNotMoleculeByFormulaAction::performCall() {
   LOG(1, "Unselecting molecules with chemical formula " << params.formula.get() << ":");
-  std::vector<molecule *> matchingMolecules = World::getInstance().getAllMolecules(MoleculeByFormula(params.formula.get()));
-  std::vector<molecule *> unselectedMolecules = World::getInstance().getAllMolecules(!MoleculesBySelection());
+  std::vector<const molecule *> matchingMolecules =
+      const_cast<const World &>(World::getInstance()).
+      getAllMolecules(MoleculeByFormula(params.formula.get()));
+  std::vector<const molecule *> unselectedMolecules =
+      const_cast<const World &>(World::getInstance()).
+      getAllMolecules(!MoleculesBySelection());
   World::getInstance().unselectAllMolecules(MoleculeByFormula(params.formula.get()));
   LOG(0, World::getInstance().countSelectedMolecules() << " molecules remain selected.");
@@ -67,5 +71,5 @@
 
   World::getInstance().selectAllMolecules(MoleculeByFormula(state->params.formula.get()));
-  BOOST_FOREACH( molecule *mol, state->unselectedMolecules)
+  BOOST_FOREACH( const molecule *mol, state->unselectedMolecules)
     World::getInstance().unselectMolecule(mol);
 
Index: src/Actions/SelectionAction/Molecules/NotMoleculeByFormulaAction.def
===================================================================
--- src/Actions/SelectionAction/Molecules/NotMoleculeByFormulaAction.def	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/NotMoleculeByFormulaAction.def	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -22,5 +22,5 @@
 (FormulaValidator())
 
-#define statetypes (std::vector<molecule*>)
+#define statetypes (std::vector<const molecule*>)
 #define statereferences (unselectedMolecules)
 
Index: src/Actions/SelectionAction/Molecules/NotMoleculeByNameAction.cpp
===================================================================
--- src/Actions/SelectionAction/Molecules/NotMoleculeByNameAction.cpp	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/NotMoleculeByNameAction.cpp	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -56,6 +56,7 @@
 ActionState::ptr SelectionNotMoleculeByNameAction::performCall() {
   LOG(1, "Unselecting all molecule called " << params.molname.get());
-  std::vector<molecule *> unselectedMolecules =
-      World::getInstance().getAllMolecules((!MoleculesBySelection()) && MoleculeByName(params.molname.get()));
+  std::vector<const molecule *> unselectedMolecules =
+      const_cast<const World &>(World::getInstance()).
+        getAllMolecules((!MoleculesBySelection()) && MoleculeByName(params.molname.get()));
   World::getInstance().unselectAllMolecules(MoleculeByName(params.molname.get()));
   LOG(0, World::getInstance().countSelectedMolecules() << " molecules remain selected.");
@@ -68,5 +69,5 @@
 
   World::getInstance().selectAllMolecules(MoleculeByName(state->params.molname.get()));
-  BOOST_FOREACH( molecule *mol, state->unselectedMolecules)
+  BOOST_FOREACH( const molecule *mol, state->unselectedMolecules)
     World::getInstance().unselectMolecule(mol);
 
Index: src/Actions/SelectionAction/Molecules/NotMoleculeByNameAction.def
===================================================================
--- src/Actions/SelectionAction/Molecules/NotMoleculeByNameAction.def	(revision 63fb7a963007e0f94b955d96ca949cd435eacb2a)
+++ src/Actions/SelectionAction/Molecules/NotMoleculeByNameAction.def	(revision f01769bf04baacedde88443ce16ab2f2dd809f30)
@@ -22,5 +22,5 @@
 (DummyValidator< std::string >())
 
-#define statetypes (std::vector<molecule *>)
+#define statetypes (std::vector<const molecule *>)
 #define statereferences (unselectedMolecules)
 
