Index: src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp	(revision 62a127cb29522511523a9fc2274cd27e608670b2)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp	(revision ee3fb8349db0a97b7274dd3ae8a157fc0387a363)
@@ -106,8 +106,8 @@
   ObservedValues(QtObservedAtom::MAX_ObservedTypes)
 {
-  boost::function<void (const atomId_t)> atomSubjectKilled(
+  boost::function<void (ObservedValue_Index_t)> atomSubjectKilled(
       boost::bind(&QtObservedAtom::countValuesSubjectKilled,
           boost::ref(*this),
-          _1));
+          boost::bind(&QtObservedAtom::getIndex, boost::ref(*this))));
   initObservedValues( ObservedValues, _id, _atom, atomSubjectKilled);
 
@@ -117,11 +117,11 @@
 QtObservedAtom::~QtObservedAtom()
 {
-  boost::any_cast<ObservedValue_wCallback<atomId_t> *>(ObservedValues[AtomIndex])->noteCallBackIsGone();
-  boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(ObservedValues[AtomBonds])->noteCallBackIsGone();
-  boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(ObservedValues[AtomElement])->noteCallBackIsGone();
-  boost::any_cast<ObservedValue_wCallback<QtObservedMolecule*, atomId_t> *>(ObservedValues[AtomMolecule])->noteCallBackIsGone();
-  boost::any_cast<ObservedValue_wCallback<std::string, atomId_t> *>(ObservedValues[AtomName])->noteCallBackIsGone();
-  boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[AtomPosition])->noteCallBackIsGone();
-  boost::any_cast<ObservedValue_wCallback<bool, atomId_t> *>(ObservedValues[AtomSelected])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<atomId_t, ObservedValue_Index_t> *>(ObservedValues[AtomIndex])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, ObservedValue_Index_t> *>(ObservedValues[AtomBonds])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<atomicNumber_t, ObservedValue_Index_t> *>(ObservedValues[AtomElement])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<QtObservedMolecule*, ObservedValue_Index_t> *>(ObservedValues[AtomMolecule])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<std::string, ObservedValue_Index_t> *>(ObservedValues[AtomName])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<Vector, ObservedValue_Index_t> *>(ObservedValues[AtomPosition])->noteCallBackIsGone();
+  boost::any_cast<ObservedValue_wCallback<bool, ObservedValue_Index_t> *>(ObservedValues[AtomSelected])->noteCallBackIsGone();
 
   deactivateObserver();
@@ -229,22 +229,22 @@
   ++signedOffChannels;
 
-  checkForRemoval();
-}
-
-void QtObservedAtom::countValuesSubjectKilled(const atomId_t _id)
-{
-  ASSERT( _id == getAtomIndex(),
-      "QtObservedAtom::countValuesSubjectKilled() - atom "+toString(getAtomIndex())
+  checkForRemoval(getIndex());
+}
+
+void QtObservedAtom::countValuesSubjectKilled(ObservedValue_Index_t _id)
+{
+  ASSERT( _id == getIndex(),
+      "QtObservedAtom::countValuesSubjectKilled() - atom "+toString(getIndex())
       +" received countValuesSubjectKilled for atom id "+toString(_id)+".");
 
   ++subjectKilledCount;
 
-  checkForRemoval();
-}
-
-#ifdef HAVE_INLINE
-inline
-#endif
-void QtObservedAtom::checkForRemoval()
+  checkForRemoval(_id);
+}
+
+#ifdef HAVE_INLINE
+inline
+#endif
+void QtObservedAtom::checkForRemoval(ObservedValue_Index_t _id)
 {
   if ((signedOffChannels == AllsignedOnChannels) && (subjectKilledCount == MAX_ObservedTypes)) {
@@ -255,6 +255,6 @@
 
     if (!BoardIsGone) {
-      board.markObservedAtomAsDisconnected(getIndex());
-      board.markObservedAtomForErase(getIndex());
+      board.markObservedAtomAsDisconnected(_id);
+      board.markObservedAtomForErase(_id);
     }
   }
@@ -332,36 +332,17 @@
     const atomId_t _id,
     const atom * const _atomref,
-    const boost::function<void(const atomId_t)> &_subjectKilled)
-{
-  /* This is an old note from when the code was still part of cstor's initializer body.
-   * TODO: Probably does not apply anymore but has not yet been tested.
-   *
-   * We must not use boost::cref(this) as "this" has not been properly constructed and seemingly
-   * boost::cref tries to do some magic to grasp the inheritance hierarchy which fails because
-   * the class has not been fully constructed yet. "This" itself seems to be working fine.
-   */
-
+    const boost::function<void(ObservedValue_Index_t)> &_subjectKilled)
+{
   ASSERT( _ObservedValues.size() == MAX_ObservedTypes,
       "QtObservedAtom::initObservedValues() - given ObservedValues has not correct size.");
 
   // fill ObservedValues: index first
+  const boost::function<ObservedValue_Index_t ()> IndexGetter =
+      boost::bind(&QtObservedAtom::getIndex,
+          boost::cref(*this));
+
+  // fill ObservedValues: then all the other that need index
   const boost::function<atomId_t ()> AtomIndexUpdater(
       boost::bind(&QtObservedAtom::updateIndex, boost::cref(*_atomref)));
-
-  ObservedValue_wCallback<atomId_t> * const IndexObservable =
-      new ObservedValue_wCallback<atomId_t>(
-          _atomref,
-          AtomIndexUpdater,
-          "AtomIndex_"+toString(_id),
-          _id,
-          AtomIndexChannels,
-          _subjectKilled);
-  _ObservedValues[AtomIndex] = IndexObservable;
-
-  const boost::function<const atomId_t ()> AtomIndexGetter =
-      boost::bind(&ObservedValue_wCallback<atomId_t>::get,
-          IndexObservable);
-
-  // fill ObservedValues: then all the other that need index
   const boost::function<ListOfBonds_t ()> AtomBondsUpdater(
       boost::bind(&QtObservedAtom::updateBonds, boost::cref(*_atomref)));
@@ -377,5 +358,13 @@
       boost::bind(&QtObservedAtom::updateSelected, boost::cref(*_atomref)));
 
-  _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t, atomId_t>(
+  _ObservedValues[AtomIndex] = new ObservedValue_wCallback<atomId_t, ObservedValue_Index_t>(
+      _atomref,
+      AtomIndexUpdater,
+      "AtomIndex_"+toString(_id),
+      _id,
+      AtomIndexChannels,
+      _subjectKilled,
+      IndexGetter);
+  _ObservedValues[AtomBonds] = new ObservedValue_wCallback<ListOfBonds_t, ObservedValue_Index_t>(
       _atomref,
       AtomBondsUpdater,
@@ -384,6 +373,6 @@
       AtomBondsChannels,
       _subjectKilled,
-      AtomIndexGetter);
-  _ObservedValues[AtomElement] = new ObservedValue_wCallback<atomicNumber_t, atomId_t>(
+      IndexGetter);
+  _ObservedValues[AtomElement] = new ObservedValue_wCallback<atomicNumber_t, ObservedValue_Index_t>(
       _atomref,
       AtomElementUpdater,
@@ -392,6 +381,6 @@
       AtomElementChannels,
       _subjectKilled,
-      AtomIndexGetter);
-  _ObservedValues[AtomMolecule] = new ObservedValue_wCallback<QtObservedMolecule*, atomId_t>(
+      IndexGetter);
+  _ObservedValues[AtomMolecule] = new ObservedValue_wCallback<QtObservedMolecule*, ObservedValue_Index_t>(
       _atomref,
       AtomMoleculeUpdater,
@@ -400,6 +389,6 @@
       AtomMoleculeChannels,
       _subjectKilled,
-      AtomIndexGetter);
-  _ObservedValues[AtomName] = new ObservedValue_wCallback<std::string, atomId_t>(
+      IndexGetter);
+  _ObservedValues[AtomName] = new ObservedValue_wCallback<std::string, ObservedValue_Index_t>(
       _atomref,
       AtomNameUpdater,
@@ -408,6 +397,6 @@
       AtomNameChannels,
       _subjectKilled,
-      AtomIndexGetter);
-  _ObservedValues[AtomPosition] = new ObservedValue_wCallback<Vector, atomId_t>(
+      IndexGetter);
+  _ObservedValues[AtomPosition] = new ObservedValue_wCallback<Vector, ObservedValue_Index_t>(
       _atomref,
       AtomPositionUpdater,
@@ -416,6 +405,6 @@
       AtomPositionChannels,
       _subjectKilled,
-      AtomIndexGetter);
-  _ObservedValues[AtomSelected] = new ObservedValue_wCallback<bool, atomId_t>(
+      IndexGetter);
+  _ObservedValues[AtomSelected] = new ObservedValue_wCallback<bool, ObservedValue_Index_t>(
       _atomref,
       AtomSelectedUpdater,
@@ -424,5 +413,5 @@
       AtomSelectedChannels,
       _subjectKilled,
-      AtomIndexGetter);
+      IndexGetter);
 }
 
@@ -430,11 +419,11 @@
     std::vector<boost::any> &_ObservedValues)
 {
-  delete boost::any_cast<ObservedValue_wCallback<atomId_t> *>(_ObservedValues[AtomIndex]);
-  delete boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(_ObservedValues[AtomBonds]);
-  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(_ObservedValues[AtomElement]);
-  delete boost::any_cast<ObservedValue_wCallback<QtObservedMolecule*, atomId_t> *>(_ObservedValues[AtomMolecule]);
-  delete boost::any_cast<ObservedValue_wCallback<std::string, atomId_t> *>(_ObservedValues[AtomName]);
-  delete boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(_ObservedValues[AtomPosition]);
-  delete boost::any_cast<ObservedValue_wCallback<bool, atomId_t> *>(_ObservedValues[AtomSelected]);
+  delete boost::any_cast<ObservedValue_wCallback<atomId_t, ObservedValue_Index_t> *>(_ObservedValues[AtomIndex]);
+  delete boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, ObservedValue_Index_t> *>(_ObservedValues[AtomBonds]);
+  delete boost::any_cast<ObservedValue_wCallback<atomicNumber_t, ObservedValue_Index_t> *>(_ObservedValues[AtomElement]);
+  delete boost::any_cast<ObservedValue_wCallback<QtObservedMolecule*, ObservedValue_Index_t> *>(_ObservedValues[AtomMolecule]);
+  delete boost::any_cast<ObservedValue_wCallback<std::string, ObservedValue_Index_t> *>(_ObservedValues[AtomName]);
+  delete boost::any_cast<ObservedValue_wCallback<Vector, ObservedValue_Index_t> *>(_ObservedValues[AtomPosition]);
+  delete boost::any_cast<ObservedValue_wCallback<bool, ObservedValue_Index_t> *>(_ObservedValues[AtomSelected]);
   _ObservedValues.clear();
 }
@@ -449,34 +438,34 @@
 const atomId_t& QtObservedAtom::getAtomIndex() const
 {
-  return boost::any_cast<ObservedValue_wCallback<atomId_t> *>(ObservedValues[AtomIndex])->get();
+  return boost::any_cast<ObservedValue_wCallback<atomId_t, ObservedValue_Index_t> *>(ObservedValues[AtomIndex])->get();
 }
 
 const QtObservedAtom::ListOfBonds_t& QtObservedAtom::getAtomBonds() const
 {
-  return boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, atomId_t> *>(ObservedValues[AtomBonds])->get();
+  return boost::any_cast<ObservedValue_wCallback<ListOfBonds_t, ObservedValue_Index_t> *>(ObservedValues[AtomBonds])->get();
 }
 
 const atomicNumber_t& QtObservedAtom::getAtomElement() const
 {
-  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t, atomId_t> *>(ObservedValues[AtomElement])->get();
+  return boost::any_cast<ObservedValue_wCallback<atomicNumber_t, ObservedValue_Index_t> *>(ObservedValues[AtomElement])->get();
 }
 
 QtObservedMolecule* const QtObservedAtom::getAtomMolecule() const
 {
-  return boost::any_cast<ObservedValue_wCallback<QtObservedMolecule*, atomId_t> *>(ObservedValues[AtomMolecule])->get();
+  return boost::any_cast<ObservedValue_wCallback<QtObservedMolecule*, ObservedValue_Index_t> *>(ObservedValues[AtomMolecule])->get();
 }
 
 const std::string& QtObservedAtom::getAtomName() const
 {
-  return boost::any_cast<ObservedValue_wCallback<std::string, atomId_t> *>(ObservedValues[AtomName])->get();
+  return boost::any_cast<ObservedValue_wCallback<std::string, ObservedValue_Index_t> *>(ObservedValues[AtomName])->get();
 }
 
 const Vector& QtObservedAtom::getAtomPosition() const
 {
-  return boost::any_cast<ObservedValue_wCallback<Vector, atomId_t> *>(ObservedValues[AtomPosition])->get();
+  return boost::any_cast<ObservedValue_wCallback<Vector, ObservedValue_Index_t> *>(ObservedValues[AtomPosition])->get();
 }
 
 const bool QtObservedAtom::getAtomSelected() const
 {
-  return boost::any_cast<ObservedValue_wCallback<bool, atomId_t> *>(ObservedValues[AtomSelected])->get();
-}
+  return boost::any_cast<ObservedValue_wCallback<bool, ObservedValue_Index_t> *>(ObservedValues[AtomSelected])->get();
+}
Index: src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp
===================================================================
--- src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp	(revision 62a127cb29522511523a9fc2274cd27e608670b2)
+++ src/UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp	(revision ee3fb8349db0a97b7274dd3ae8a157fc0387a363)
@@ -207,5 +207,5 @@
       const atomId_t _id,
       const atom * const _atomref,
-      const boost::function<void(const atomId_t)> &_subjectKilled);
+      const boost::function<void(ObservedValue_Index_t)> &_subjectKilled);
 
   /** Destroys all \a ObservedValues entries.
@@ -227,5 +227,5 @@
    * \param _id id to check against ours
    */
-  void countValuesSubjectKilled(const atomId_t _id);
+  void countValuesSubjectKilled(ObservedValue_Index_t _id);
 
   //!> counts how many ObservedValues have already been subjectKilled()
@@ -235,6 +235,7 @@
    * this instance and all its internal observed values.
    *
-   */
-  void checkForRemoval();
+   * \param _id id to check against ours
+   */
+  void checkForRemoval(ObservedValue_Index_t _id);
 
 private:
