diff --git a/DDCore/include/DD4hep/Memory.h b/DDCore/include/DD4hep/Memory.h
index 511802878238ef774e15b9f9750fde798201ef1e..175cee294f5976bf8c573dd641f184e4780060b1 100644
--- a/DDCore/include/DD4hep/Memory.h
+++ b/DDCore/include/DD4hep/Memory.h
@@ -36,7 +36,9 @@ namespace DD4hep  {
   : public std::auto_ptr<T>  {
  public:
     typedef std::auto_ptr<T> base_t;
-    void swap(base_t& c) { *this = c; c.release(); }
+    void swap(base_t& c) {
+      this->base_t::operator=(base_t(c.release()));
+    }
 #endif
     /// Default Constructor.
     dd4hep_ptr() : base_t() {}
@@ -46,7 +48,9 @@ namespace DD4hep  {
     dd4hep_ptr(base_t& c) : base_t(c) {}
     /// Assignment operator
     dd4hep_ptr& operator=(base_t& c) {
-      this->swap(c);
+      if ( this != &c )  {
+	this->swap(c);
+      }
       return *this;
     }
   };
diff --git a/DDDetectors/src/SubdetectorAssembly_geo.cpp b/DDDetectors/src/SubdetectorAssembly_geo.cpp
index e15f5225ca22189832a9e555a62c8cc43d359c92..c8d30e68ec1c25ce82cc7c0b58ab65b990876639 100644
--- a/DDDetectors/src/SubdetectorAssembly_geo.cpp
+++ b/DDDetectors/src/SubdetectorAssembly_geo.cpp
@@ -20,10 +20,10 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t)  {
   DetElement sdet(det_name, x_det.id());
   Volume     vol;
 
-  bool useRot = false ;
-  bool usePos = false ; 
-  Position    pos ;
-  RotationZYX rot ;
+  bool useRot = false;
+  bool usePos = false; 
+  Position    pos;
+  RotationZYX rot;
 
   if ( x_det.hasChild(_U(shape)) )  {
     xml_comp_t x_shape = x_det.child(_U(shape));
@@ -32,14 +32,14 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t)  {
     Material   mat   = lcdd.material(x_shape.materialStr());
     printout(DEBUG,det_name,"+++ Creating detector assembly with shape of type:%s",type.c_str());
     vol = Volume(det_name,solid,mat);
-    
-    if( x_shape.hasChild( _U(position) ) ) {
-      usePos = true ;
-      pos = Position(   x_shape.position().x() , x_shape.position().y(),   x_shape.position().z()    ) ;
+
+    usePos = x_shape.hasChild(_U(position));
+    useRot = x_shape.hasChild(_U(rotation));
+    if( usePos ) {
+      pos = Position(x_shape.position().x(), x_shape.position().y(), x_shape.position().z());
     }
-    if( x_shape.hasChild( _U(rotation) ) ) {
-      useRot = true ;
-      rot = RotationZYX(   x_shape.rotation().x() , x_shape.rotation().y(),   x_shape.rotation().z()    ) ;
+    if( useRot ) {
+      rot = RotationZYX(x_shape.rotation().x(), x_shape.rotation().y(), x_shape.rotation().z());
     }
   }
   else  {
@@ -55,30 +55,19 @@ static Ref_t create_element(LCDD& lcdd, xml_h e, Ref_t)  {
 
   vol.setAttributes(lcdd,x_det.regionStr(),x_det.limitsStr(),x_det.visStr());
 
-  Volume mother = lcdd.pickMotherVolume(sdet) ;
-  PlacedVolume pv ;
-
+  Volume mother = lcdd.pickMotherVolume(sdet);
+  PlacedVolume pv;
   if( useRot && usePos ){
-
-    pv =  mother.placeVolume( vol , Transform3D( rot, pos )  ) ;
-
+    pv =  mother.placeVolume(vol, Transform3D(rot, pos));
   } else if( useRot ){
-
-    pv =  mother.placeVolume( vol , rot  ) ;
-
+    pv =  mother.placeVolume(vol, rot);
   } else if( usePos ){
-
-    pv =  mother.placeVolume( vol , pos  ) ;
-
+    pv =  mother.placeVolume(vol, pos);
   } else {
-
-    pv = mother.placeVolume( vol );
+    pv = mother.placeVolume(vol);
   }
 
-  pv.addPhysVolID("system", sdet.id() );
-  
   sdet.setPlacement(pv);
-  
   return sdet;
 }