diff --git a/indra/llmath/lloctree.h b/indra/llmath/lloctree.h
index 127d041b4a764ce0724b4f64223e19f94a5a8c7a..70e2f23ef9004d7da99c1a873682e6655bcaf569 100644
--- a/indra/llmath/lloctree.h
+++ b/indra/llmath/lloctree.h
@@ -402,28 +402,6 @@ class LLOctreeNode : public LLTreeNode<T>
 				child->insert(data);
 			}
 		}
-		else if (parent)
-		{
-			//it's not in here, give it to the root
-			OCT_ERRS << "Octree insertion failed, starting over from root!" << LL_ENDL;
-
-			oct_node* node = this;
-
-			while (parent)
-			{
-				node = parent;
-				parent = node->getOctParent();
-			}
-
-			node->insert(data);
-		}
-		else
-		{
-			// It's not in here, and we are root.
-			// LLOctreeRoot::insert() should have expanded
-			// root by now, something is wrong
-			OCT_ERRS << "Octree insertion failed! Root expansion failed." << LL_ENDL;
-		}
 
 		return false;
 	}
diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp
index 6effc71229e241539002d88f4b39fbd1825e44c3..ef581fb3e4329980b849b060bb141b6741bfa39f 100644
--- a/indra/newview/llviewermessage.cpp
+++ b/indra/newview/llviewermessage.cpp
@@ -3382,6 +3382,22 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**)
 		gAgent.getRegion()->getOriginGlobal());
 	gAgent.setRegion(regionp);
 	gObjectList.shiftObjects(shift_vector);
+
+	// Is this a really long jump?
+	if (shift_vector.length() > 2048.f * 256.f)
+	{
+		regionp->reInitPartitions();
+		gAgent.setRegion(regionp);
+		// Kill objects in the regions we left behind
+		for (LLViewerRegion* r : LLWorld::getInstance()->getRegionList())
+		{
+			if (r != regionp)
+			{
+				gObjectList.killObjects(r);
+			}
+		}
+	}
+
 	gAssetStorage->setUpstream(msg->getSender());
 	gCacheName->setUpstream(msg->getSender());
 	gViewerThrottle.sendToSim();