Index: source/ariba/overlay/BaseOverlay.cpp
===================================================================
--- source/ariba/overlay/BaseOverlay.cpp	(revision 6872)
+++ source/ariba/overlay/BaseOverlay.cpp	(revision 6873)
@@ -69,5 +69,5 @@
 public:
 	ValueEntry( const Data& value ) : ttl(0), last_update(time(NULL)),
-	last_change(time(NULL)), value(value.clone()) {
+		last_change(time(NULL)), value(value.clone()) {
 	}
 
@@ -1138,5 +1138,5 @@
 	// resolve end-point descriptor from the base-overlay routing table
 	const EndpointDescriptor& ep = overlayInterface->resolveNode( node );
-	if(ep != EndpointDescriptor::UNSPECIFIED()) return ep;
+	if(ep.toString() != "") return ep;
 
 	// see if we can find the node in our own table
@@ -1144,5 +1144,5 @@
 		if(ld->remoteNode != node) continue;
 		const EndpointDescriptor& ep = bc->getEndpointDescriptor(ld->communicationId);
-		if(ep.toString().size()==0) continue;
+		if(ep.toString() == "") continue;
 		if(ep != EndpointDescriptor::UNSPECIFIED()) return ep;
 	}
@@ -2088,10 +2088,12 @@
 	}
 
-	// re-publish values
+	// erase old values from local DHT
 	BOOST_FOREACH( DHTEntry& entry, localDHT->entries ) {
 		// erase old entries
 		entry.erase_expired_entries();
-
-		// re-publish values
+	}
+
+	// re-publish values
+	BOOST_FOREACH( DHTEntry& entry, localDHT->entries ) {
 		BOOST_FOREACH( ValueEntry& value, entry.values )
 			dhtPut(entry.key, value.get_value(), 0, true );
@@ -2184,9 +2186,9 @@
 	// calculate hash
 	NodeID dest = NodeID::sha1(key.getBuffer(), key.getLength() / 8);
-	DHTMessage dhtmsg(key,value);
-	dhtmsg.setReplace(replace);
+	DHTMessage dhtmsg( key, value );
+	dhtmsg.setReplace( replace );
 	dhtmsg.setTTL(ttl);
 
-	OverlayMsg msg(OverlayMsg::typeDHTPut);
+	OverlayMsg msg( OverlayMsg::typeDHTPut );
 	msg.encapsulate( &dhtmsg );
 	dhtSend(&msg, dest);
