diff --git a/db/model/persisted_revision.go b/db/model/persisted_revision.go
index b9aad44..e0fcb10 100644
--- a/db/model/persisted_revision.go
+++ b/db/model/persisted_revision.go
@@ -345,24 +345,21 @@
 // Drop takes care of eliminating a revision hash that is no longer needed
 // and its associated config when required
 func (pr *PersistedRevision) StorageDrop(txid string, includeConfig bool) {
-	log.Debugw("dropping-revision", log.Fields{"txid": txid, "hash": pr.GetHash(), "config-hash": pr.GetConfig().Hash})
+	log.Debugw("dropping-revision", log.Fields{"txid": txid, "hash": pr.GetHash(), "config-hash": pr.GetConfig().Hash, "key": pr.GetName(), "isStored": pr.isStored})
 
 	pr.mutex.Lock()
 	defer pr.mutex.Unlock()
 	if pr.kvStore != nil && txid == "" {
-		if pr.isStored {
-			if pr.isWatched {
-				pr.kvStore.DeleteWatch(pr.GetName(), pr.events)
-				pr.isWatched = false
-			}
-
-			if err := pr.kvStore.Delete(pr.GetName()); err != nil {
-				log.Errorw("failed-to-remove-revision", log.Fields{"hash": pr.GetHash(), "error": err.Error()})
-			} else {
-				pr.isStored = false
-			}
+		if pr.isWatched {
+			pr.kvStore.DeleteWatch(pr.GetName(), pr.events)
+			pr.isWatched = false
 		}
 
+		if err := pr.kvStore.Delete(pr.GetName()); err != nil {
+			log.Errorw("failed-to-remove-revision", log.Fields{"hash": pr.GetHash(), "error": err.Error()})
+		} else {
+			pr.isStored = false
+		}
 	} else {
 		if includeConfig {
 			log.Debugw("attempted-to-remove-transacted-revision-config", log.Fields{"hash": pr.GetConfig().Hash, "txid": txid})
diff --git a/rw_core/core/device_agent.go b/rw_core/core/device_agent.go
index 8cbc63a..d71da27 100755
--- a/rw_core/core/device_agent.go
+++ b/rw_core/core/device_agent.go
@@ -150,7 +150,8 @@
 func (agent *DeviceAgent) stop(ctx context.Context) {
 	agent.lockDevice.Lock()
 	defer agent.lockDevice.Unlock()
-	log.Debug("stopping-device-agent")
+
+	log.Debugw("stopping-device-agent", log.Fields{"deviceId": agent.deviceID, "parentId": agent.parentID})
 
 	// First unregister any callbacks
 	agent.deviceProxy.UnregisterCallback(model.POST_UPDATE, agent.processUpdate)
@@ -165,8 +166,7 @@
 		log.Debugw("device-already-removed", log.Fields{"id": agent.deviceID})
 	}
 	agent.exitChannel <- 1
-	log.Debug("device-agent-stopped")
-
+	log.Debugw("device-agent-stopped", log.Fields{"deviceId": agent.deviceID, "parentId": agent.parentID})
 }
 
 // Load the most recent state from the KVStore for the device.
diff --git a/rw_core/core/device_manager.go b/rw_core/core/device_manager.go
index 0094264..59cf0a4 100755
--- a/rw_core/core/device_manager.go
+++ b/rw_core/core/device_manager.go
@@ -246,11 +246,7 @@
 					log.Errorw("unable-to-abandon-the-device", log.Fields{"error": err})
 				}
 			}
-			// stop managing the child devices
-			childDeviceIds := dMgr.getAllDeviceIdsWithDeviceParentID(id)
-			for _, cID := range childDeviceIds {
-				dMgr.stopManagingDevice(cID)
-			}
+			// We do not need to stop the child devices as this is taken care by the state machine.
 		}
 		if agent := dMgr.getDeviceAgent(id); agent != nil {
 			agent.stop(context.TODO())
@@ -1268,10 +1264,9 @@
 			if err = agent.deleteDevice(context.TODO()); err != nil {
 				log.Errorw("failure-delete-device", log.Fields{"deviceId": childDeviceID, "error": err.Error()})
 				allChildDeleted = false
-			} else {
-				agent.stop(context.TODO())
-				dMgr.deleteDeviceAgentFromMap(agent)
 			}
+			// No further action is required here.  The deleteDevice will change the device state where the resulting
+			// callback will take care of cleaning the child device agent.
 		}
 	}
 	if !allChildDeleted {
@@ -1280,22 +1275,6 @@
 	return nil
 }
 
-//getAllDeviceIdsWithDeviceParentId returns the list of device Ids which has id as parent Id.  This function uses the
-// data from the agent instead of using the data from the parent device as that data would disappear from a parent
-// device during a delete device operation.
-func (dMgr *DeviceManager) getAllDeviceIdsWithDeviceParentID(id string) []string {
-	log.Debugw("getAllAgentsWithDeviceParentId", log.Fields{"parentDeviceId": id})
-	deviceIds := make([]string, 0)
-	dMgr.deviceAgents.Range(func(key, value interface{}) bool {
-		agent := value.(*DeviceAgent)
-		if agent.parentID == id {
-			deviceIds = append(deviceIds, key.(string))
-		}
-		return true
-	})
-	return deviceIds
-}
-
 //getAllChildDeviceIds is a helper method to get all the child device IDs from the device passed as parameter
 func (dMgr *DeviceManager) getAllChildDeviceIds(parentDevice *voltha.Device) ([]string, error) {
 	log.Debugw("getAllChildDeviceIds", log.Fields{"parentDeviceId": parentDevice.Id})
diff --git a/rw_core/core/logical_device_agent.go b/rw_core/core/logical_device_agent.go
index 5da6d40..097f9ab 100644
--- a/rw_core/core/logical_device_agent.go
+++ b/rw_core/core/logical_device_agent.go
@@ -111,6 +111,7 @@
 		ld.SwitchFeatures = (proto.Clone(switchCap.SwitchFeatures)).(*ofp.OfpSwitchFeatures)
 		ld.Flows = &ofp.Flows{Items: nil}
 		ld.FlowGroups = &ofp.FlowGroups{Items: nil}
+		ld.Ports = []*voltha.LogicalPort{}
 
 		agent.lockLogicalDevice.Lock()
 		// Save the logical device
