diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h
index 417bdc7c50819d3207ccd371f36042f7a6bde1fe..1a75921c09c1be8f9b641aa29a93136f72a6d94d 100755
--- a/indra/llcorehttp/_httpoperation.h
+++ b/indra/llcorehttp/_httpoperation.h
@@ -162,7 +162,7 @@ class HttpOperation : private boost::noncopyable,
         ptr_t ptr = findByHandle(handle);
         if (!ptr)
             return boost::shared_ptr< OPT >();
-        return boost::dynamic_pointer_cast<HttpOpRequest>(ptr);
+        return boost::dynamic_pointer_cast< OPT >(ptr);
     }
 	
 protected:
diff --git a/indra/llcorehttp/httprequest.cpp b/indra/llcorehttp/httprequest.cpp
index 1c7994927bd0023cf56c5f1b14a5608bee143d15..e09f0c3b186d89d5c5154092cb476b017b1cee66 100755
--- a/indra/llcorehttp/httprequest.cpp
+++ b/indra/llcorehttp/httprequest.cpp
@@ -443,13 +443,13 @@ HttpStatus HttpRequest::update(long usecs)
 				 ++iter)
 			{
 				// Swap op pointer for NULL;
-				op = *iter; *iter = NULL;	
+                op.reset();
+                op.swap(*iter);
 			
 				// Process operation
 				op->visitNotifier(this);
 		
 				// We're done with the operation
-                op.reset();
 			}
 		}
 	}