Index: src/Patterns/Observer.hpp
===================================================================
--- src/Patterns/Observer.hpp	(revision ac9b567dcfceb87f9ec160392d8deff13fa247d5)
+++ src/Patterns/Observer.hpp	(revision f721c640ec1d531c6aabbc1c140b99499b4a3ebf)
@@ -20,4 +20,7 @@
  * Observation blocks from there, these functions wont trigger notifications. Only the end
  * of the final observation block triggers the update of Observers.
+ *
+ * Returning from observed code should be done using the RETURN_OBSERVER() macro. This way the Observer mechanism
+ * is notified that the method is left.
  *
  * Each observerable can have sub-observables. When one of these sub-observables changes and
@@ -78,3 +81,4 @@
 #define START_OBSERVER Observable::start_observer_internal(this);do{do{}while(0)
 #define FINISH_OBSERVER }while(0);Observable::finish_observer_internal(this)
+#define RETURN_OBSERVER( retval ) do{Observable::finish_observer_internal(this); return (retval);}while(0)
 #endif /* OBSERVER_HPP_ */
Index: src/molecule.cpp
===================================================================
--- src/molecule.cpp	(revision ac9b567dcfceb87f9ec160392d8deff13fa247d5)
+++ src/molecule.cpp	(revision f721c640ec1d531c6aabbc1c140b99499b4a3ebf)
@@ -103,4 +103,6 @@
 bool molecule::AddAtom(atom *pointer)
 {
+  bool retval = false;
+  START_OBSERVER;
   if (pointer != NULL) {
     pointer->sort = &pointer->nr;
@@ -119,7 +121,8 @@
       }
     }
-    return add(pointer, end);
-  } else
-    return false;
+    retval = add(pointer, end);
+  }
+  FINISH_OBSERVER;
+  return retval;
 };
 
@@ -131,4 +134,6 @@
 atom * molecule::AddCopyAtom(atom *pointer)
 {
+  atom *retval = NULL;
+  START_OBSERVER;
   if (pointer != NULL) {
     atom *walker = new atom(pointer);
@@ -140,7 +145,8 @@
       NoNonHydrogen++;
     AtomCount++;
-    return walker;
-  } else
-    return NULL;
+    retval=walker;
+  }
+  FINISH_OBSERVER;
+  return retval;
 };
 
@@ -181,8 +187,9 @@
 bool molecule::AddHydrogenReplacementAtom(bond *TopBond, atom *BottomOrigin, atom *TopOrigin, atom *TopReplacement, bool IsAngstroem)
 {
+  bool AllWentWell = true;    // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit
+  START_OBSERVER;
   double bondlength;  // bond length of the bond to be replaced/cut
   double bondangle;  // bond angle of the bond to be replaced/cut
   double BondRescale;   // rescale value for the hydrogen bond length
-  bool AllWentWell = true;    // flag gathering the boolean return value of molecule::AddAtom and other functions, as return value on exit
   bond *FirstBond = NULL, *SecondBond = NULL; // Other bonds in double bond case to determine "other" plane
   atom *FirstOtherAtom = NULL, *SecondOtherAtom = NULL, *ThirdOtherAtom = NULL; // pointer to hydrogen atoms to be added
@@ -228,5 +235,5 @@
   if (BondRescale == -1) {
     eLog() << Verbose(1) << "There is no typical hydrogen bond distance in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;
-    return false;
+    RETURN_OBSERVER(false);
     BondRescale = bondlength;
   } else {
@@ -308,5 +315,5 @@
       if (bondangle == -1) {
         eLog() << Verbose(1) << "There is no typical hydrogen bond angle in replacing bond (" << TopOrigin->Name << "<->" << TopReplacement->Name << ") of degree " << TopBond->BondDegree << "!" << endl;
-        return false;
+        RETURN_OBSERVER(false);
         bondangle = 0;
       }
@@ -435,4 +442,5 @@
   Free(&matrix);
 
+  FINISH_OBSERVER;
 //  Log() << Verbose(3) << "End of AddHydrogenReplacementAtom." << endl;
   return AllWentWell;
@@ -446,4 +454,5 @@
 bool molecule::AddXYZFile(string filename)
 {
+
   istringstream *input = NULL;
   int NumberOfAtoms = 0; // atom number in xyz read
@@ -459,4 +468,5 @@
     return false;
 
+  START_OBSERVER;
   getline(xyzfile,line,'\n'); // Read numer of atoms in file
   input = new istringstream(line);
@@ -499,4 +509,5 @@
   xyzfile.close();
   delete(input);
+  FINISH_OBSERVER;
   return true;
 };
