diff --git a/objectstore/Algorithms.hpp b/objectstore/Algorithms.hpp
index e1ac501d02a2fee1fa00bd107c3039bffb287c71..8fbee087abd532f33ecbd067ccdce5fa3e24b5f9 100644
--- a/objectstore/Algorithms.hpp
+++ b/objectstore/Algorithms.hpp
@@ -205,10 +205,12 @@ public:
     }
   }
   
-  /** Reference objects in the container if needed and then switch their ownership (if needed). Objects 
-   * are expected to be owned by agent, and not listed in the container but situations might vary.
-   * This function is typically used by the garbage collector. We do noe take care of dereferencing
-   * the object from the caller.
+  /**
+   * Reference objects in the container if needed and then switch their ownership (if needed).
+   *
+   * Objects are expected to be owned by an agent and not listed in the container, but situations
+   * might vary. This function is typically used by the garbage collector. We do not take care of
+   * dereferencing the object from the caller.
    */
   void referenceAndSwitchOwnershipIfNecessary(const typename ContainerTraits<C>::ContainerIdentifier & contId,
       typename ContainerTraits<C>::ContainerAddress & previousOwnerAddress,
diff --git a/objectstore/AlgorithmsTest.cpp b/objectstore/AlgorithmsTest.cpp
index 27001f5dd9affb0091ef7dacbd454cc8dc733a9c..a28094e2181ddc6e925094ca1c3884f429e8a533 100644
--- a/objectstore/AlgorithmsTest.cpp
+++ b/objectstore/AlgorithmsTest.cpp
@@ -177,7 +177,15 @@ TEST(ObjectStore, RetrieveQueueAlgorithms) {
   ContainerAlgorithms<RetrieveQueue> retrieveAlgos(be, agentRef);
   try {
     ASSERT_EQ(requests.size(), 10);
+
+#if 1
+    auto a1 = agentRef.getAgentAddress();
+    auto a2 = agentRef.getAgentAddress();
+    retrieveAlgos.referenceAndSwitchOwnershipIfNecessary("VID", a1, a2, requests, lc);
+#else
     retrieveAlgos.referenceAndSwitchOwnership("VID", requests, lc);
+#endif
+
     // Now get the requests back
     ContainerTraits<RetrieveQueue>::PopCriteria popCriteria;
     popCriteria.bytes = std::numeric_limits<decltype(popCriteria.bytes)>::max();
diff --git a/objectstore/RetrieveQueueAlgorithms.cpp b/objectstore/RetrieveQueueAlgorithms.cpp
index 64be8fdd77b67a016acd3805a4d3b3cffa861b0b..254dc117616156b2b26881d60918e856e1304da1 100644
--- a/objectstore/RetrieveQueueAlgorithms.cpp
+++ b/objectstore/RetrieveQueueAlgorithms.cpp
@@ -149,23 +149,16 @@ addReferencesAndCommit(Container &cont, InsertedElement::list &elemMemCont, Agen
 }
 
 template<>
-void ContainerTraits<RetrieveQueue>::addReferencesIfNecessaryAndCommit(Container& cont,
-  InsertedElement::list& elemMemCont, AgentReference& agentRef, log::LogContext& lc)
+void ContainerTraits<RetrieveQueue>::
+addReferencesIfNecessaryAndCommit(Container& cont, InsertedElement::list& elemMemCont,
+  AgentReference& agentRef, log::LogContext& lc)
 {
-  throw std::runtime_error("ContainerTraits<RetrieveQueue>::addReferencesIfNecessaryAndCommit(): Not implemented");
-#if 0
-  std::list<ArchiveQueue::JobToAdd> jobsToAdd;
-  for (auto & e: elemMemCont) {
-    ElementDescriptor jd;
-    jd.copyNb = e.copyNb;
-    jd.tapePool = cont.getTapePool();
-    jd.owner = cont.getAddressIfSet();
-    ArchiveRequest & ar = *e.archiveRequest;
-    jobsToAdd.push_back({jd, ar.getAddressIfSet(), e.archiveFile.archiveFileID, e.archiveFile.fileSize,
-        e.mountPolicy, time(nullptr)});
+  std::list<RetrieveQueue::JobToAdd> jobsToAdd;
+  for (auto &e : elemMemCont) {
+    RetrieveRequest &rr = *e.retrieveRequest;
+    jobsToAdd.push_back({e.copyNb, e.fSeq, rr.getAddressIfSet(), e.filesize, e.policy, ::time(nullptr)});
   }
   cont.addJobsIfNecessaryAndCommit(jobsToAdd, agentRef, lc);
-#endif
 }
 
 template<>