diff --git a/indra/llcommon/lldate.cpp b/indra/llcommon/lldate.cpp
index 30916966afb34ca2714847f312a983b6182f3ac5..37b912df3dbf71a6e2eb9a9670f00f6e0dc29687 100644
--- a/indra/llcommon/lldate.cpp
+++ b/indra/llcommon/lldate.cpp
@@ -64,6 +64,8 @@ LLDate::LLDate(const std::string& iso8601_date)
 {
 	if(!fromString(iso8601_date))
 	{
+		llwarns << "date " << iso8601_date << " failed to parse; "
+			<< "ZEROING IT OUT" << llendl;
 		mSecondsSinceEpoch = DATE_EPOCH;
 	}
 }
@@ -215,7 +217,7 @@ bool LLDate::fromStream(std::istream& s)
 		s >> fractional;
 		seconds_since_epoch += fractional;
 	}
-	s.get(); // skip the Z
+	c = s.get(); // skip the Z
 	if (c != 'Z') { return false; }
 
 	mSecondsSinceEpoch = seconds_since_epoch;
diff --git a/indra/llmath/llvolume.cpp b/indra/llmath/llvolume.cpp
index 303b3e257d09f80ef511842dd78f863d9cf2888a..9cad612f245f822936fbe4201e524a8645555dab 100644
--- a/indra/llmath/llvolume.cpp
+++ b/indra/llmath/llvolume.cpp
@@ -86,6 +86,8 @@ const S32 SCULPT_REZ_2 = 8;
 const S32 SCULPT_REZ_3 = 16;
 const S32 SCULPT_REZ_4 = 32;
 
+const F32 SCULPT_MIN_AREA = 0.005f;
+
 BOOL check_same_clock_dir( const LLVector3& pt1, const LLVector3& pt2, const LLVector3& pt3, const LLVector3& norm)
 {    
 	LLVector3 test = (pt2-pt1)%(pt3-pt2);
@@ -1828,6 +1830,18 @@ void LLVolume::createVolumeFaces()
 }
 
 
+inline LLVector3 sculpt_rgb_to_vector(U8 r, U8 g, U8 b)
+{
+	// maps RGB values to vector values [0..255] -> [-0.5..0.5]
+	LLVector3 value;
+	value.mV[VX] = r / 256.f - 0.5f;
+	value.mV[VY] = g / 256.f - 0.5f;
+	value.mV[VZ] = b / 256.f - 0.5f;
+
+	return value;
+}
+
+
 // sculpt replaces generate() for sculpted surfaces
 void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components, const U8* sculpt_data, S32 sculpt_level)
 {
@@ -1852,40 +1866,39 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
 	mMesh.resize(sizeS * sizeT);
 	sNumMeshPoints += mMesh.size();
 
-	S32 vertex_change = 0;
+	F32 area = 0;
 	// first test to see if image has enough variation to create non-degenerate geometry
 	if (!data_is_empty)
 	{
-		S32 last_index = 0;
-		for (S32 s = 0; s < sizeS; s++)
-			for (S32 t = 0; t < sizeT; t++)
+		for (S32 s = 0; s < sizeS - 1; s++)
+			for (S32 t = 0; t < sizeT - 1; t++)
 			{
-				U32 x = (U32) ((F32)s/(sizeS-1) * (F32) sculpt_width);
-				U32 y = (U32) ((F32)t/(sizeT-1) * (F32) sculpt_height);
+				// first coordinate
+				U32 x = (U32) ((F32)s/(sizeS) * (F32) sculpt_width);
+				U32 y = (U32) ((F32)t/(sizeT) * (F32) sculpt_height);
 
-				if (y == sculpt_height)  // stitch bottom
-				{
-					y = sculpt_height - 1;
-					x = sculpt_width / 2;
-				}
-
-				if (x == sculpt_width)   // stitch sides
-					x = 0;
-
-				if (y == 0)  // stitch top
-					x = sculpt_width / 2;
-
-				U32 index = (x + y * sculpt_width) * sculpt_components;
-
-				if (fabs((F32)(sculpt_data[index] - sculpt_data[last_index])) +
-					fabs((F32)(sculpt_data[index+1] - sculpt_data[last_index+1])) +
-					fabs((F32)(sculpt_data[index+2] - sculpt_data[last_index+2])) > 0)
-					vertex_change++;
-
-				last_index = index;
+				// coordinate offset by 1
+				U32 x2 = (U32) ((F32)(s+1)/(sizeS) * (F32) sculpt_width);
+				U32 y2 = (U32) ((F32)(t+1)/(sizeT) * (F32) sculpt_height);
+					
+				// three points on a triagle - find the image indices first
+				U32 p1_index = (x + y * sculpt_width) * sculpt_components;
+				U32 p2_index = (x2 + y * sculpt_width) * sculpt_components;
+				U32 p3_index = (x + y2 * sculpt_width) * sculpt_components;
+
+				// convert image data to vectors
+				LLVector3 p1 = sculpt_rgb_to_vector(sculpt_data[p1_index], sculpt_data[p1_index+1], sculpt_data[p1_index+2]);
+				LLVector3 p2 = sculpt_rgb_to_vector(sculpt_data[p2_index], sculpt_data[p2_index+1], sculpt_data[p2_index+2]);
+				LLVector3 p3 = sculpt_rgb_to_vector(sculpt_data[p3_index], sculpt_data[p3_index+1], sculpt_data[p3_index+2]);
+
+				// compute the area of the parallelogram by taking the length of the cross product:
+				// (parallegram is an approximation of two triangles)
+				LLVector3 cross = (p1 - p2) % (p1 - p3);
+				// take length squared for efficiency (no sqrt)
+				area += cross.magVecSquared();
 			}
 		
-		if ((F32)vertex_change / sizeS / sizeT < 0.02) // less than 2%
+		if (area < SCULPT_MIN_AREA * SCULPT_MIN_AREA)
 			data_is_empty = TRUE;
 	}
 
@@ -1977,9 +1990,7 @@ void LLVolume::sculpt(U16 sculpt_width, U16 sculpt_height, S8 sculpt_components,
 
 				
 				U32 index = (x + y * sculpt_width) * sculpt_components;
-				pt.mPos.mV[0] = sculpt_data[index  ] / 256.f - 0.5f;
-				pt.mPos.mV[1] = sculpt_data[index+1] / 256.f - 0.5f;
-				pt.mPos.mV[2] = sculpt_data[index+2] / 256.f - 0.5f;
+				pt.mPos = sculpt_rgb_to_vector(sculpt_data[index], sculpt_data[index+1], sculpt_data[index+2]);
 			}
 			line += sizeT;
 		}
diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp
index 628f7f8cc83d12aeb9efd77f0d163e6b49363d65..b41879380fafdcd929d9d6e0223f929738a601fc 100644
--- a/indra/llprimitive/llprimitive.cpp
+++ b/indra/llprimitive/llprimitive.cpp
@@ -863,6 +863,7 @@ void LLPrimitive::copyTEs(const LLPrimitive *primitivep)
 		setTERotation(i, tep->getRotation());
 		setTEBumpShinyFullbright(i, tep->getBumpShinyFullbright());
 		setTEMediaTexGen(i, tep->getMediaTexGen());
+		setTEGlow(i, tep->getGlow());
 	}
 }
 
diff --git a/indra/llprimitive/lltextureentry.h b/indra/llprimitive/lltextureentry.h
index d8efb5993e75cda16978ad67633730abc29340a3..960d97ba0c8274ea0545b6b6e69fcbdf73fbe4a2 100644
--- a/indra/llprimitive/lltextureentry.h
+++ b/indra/llprimitive/lltextureentry.h
@@ -147,6 +147,10 @@ class LLTextureEntry
 	U8					mBump;					// Bump map, shiny, and fullbright
 	U8					mMediaFlags;			// replace with web page, movie, etc.
 	F32                 mGlow;
+
+	// NOTE: when adding new data to this class, in addition to adding it to the serializers asLLSD/fromLLSD and the
+	// message packers (e.g. LLPrimitive::packTEMessage) you must also implement its copy in LLPrimitive::copyTEs()
+
 	
 };
 
diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp
index 37ee4c46baa7d4c79583a09c45acaf112f89651b..9671065ed260684e38acc1a4b2108b8f2eccdb74 100644
--- a/indra/llui/lllineeditor.cpp
+++ b/indra/llui/lllineeditor.cpp
@@ -1807,7 +1807,7 @@ BOOL LLLineEditor::prevalidateFloat(const LLWString &str)
 
 		for( ; i < len; i++ )
 		{
-			if( (decimal_point != trimmed[i] ) && !isdigit( trimmed[i] ) )
+			if( (decimal_point != trimmed[i] ) && !LLStringOps::isDigit( trimmed[i] ) )
 			{
 				success = FALSE;
 				break;
@@ -1862,7 +1862,7 @@ BOOL LLLineEditor::postvalidateFloat(const LLString &str)
 				}
 			}
 			else
-			if( isdigit( trimmed[i] ) )
+			if( LLStringOps::isDigit( trimmed[i] ) )
 			{
 				has_digit = TRUE;
 			}
@@ -1905,7 +1905,7 @@ BOOL LLLineEditor::prevalidateInt(const LLWString &str)
 
 		for( ; i < len; i++ )
 		{
-			if( !isdigit( trimmed[i] ) )
+			if( !LLStringOps::isDigit( trimmed[i] ) )
 			{
 				success = FALSE;
 				break;
@@ -1934,7 +1934,7 @@ BOOL LLLineEditor::prevalidatePositiveS32(const LLWString &str)
 		S32 i = 0;
 		while(success && (i < len))
 		{
-			if(!isdigit(trimmed[i++]))
+			if(!LLStringOps::isDigit(trimmed[i++]))
 			{
 				success = FALSE;
 			}
@@ -1968,7 +1968,7 @@ BOOL LLLineEditor::prevalidateNonNegativeS32(const LLWString &str)
 		S32 i = 0;
 		while(success && (i < len))
 		{
-			if(!isdigit(trimmed[i++]))
+			if(!LLStringOps::isDigit(trimmed[i++]))
 			{
 				success = FALSE;
 			}
diff --git a/indra/newview/llchatbar.cpp b/indra/newview/llchatbar.cpp
index 21a5e08587fd8d32d53fee060744f20a494e1d9d..3517c1e18a08a6a5a10897d0f8b0f66deed4226f 100644
--- a/indra/newview/llchatbar.cpp
+++ b/indra/newview/llchatbar.cpp
@@ -456,7 +456,7 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
 	}
 	else if (mesg[0] == '/'
 			 && mesg[1]
-			 && isdigit(mesg[1]))
+			 && LLStringOps::isDigit(mesg[1]))
 	{
 		// This a special "/20" speak on a channel
 		S32 pos = 0;
@@ -470,7 +470,7 @@ LLWString LLChatBar::stripChannelNumber(const LLWString &mesg, S32* channel)
 			channel_string[pos] = c;
 			pos++;
 		}
-		while(c && pos < 64 && isdigit(c));
+		while(c && pos < 64 && LLStringOps::isDigit(c));
 		
 		// Move the pointer forward to the first non-whitespace char
 		// Check isspace before looping, so we can handle "/33foo"
diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp
index 23d01a963bf6ba79bef93c9dd5eae5e86e022611..bdb7f09e22067f376303d08652f1d662ee29edb6 100644
--- a/indra/newview/llfloaterworldmap.cpp
+++ b/indra/newview/llfloaterworldmap.cpp
@@ -298,20 +298,6 @@ void LLFloaterWorldMap::onClose(bool app_quitting)
 	setVisible(FALSE);
 }
 
-// Allow us to download landmarks quickly when map is shown
-class LLLandmarkFetchDescendentsObserver : public LLInventoryFetchDescendentsObserver
-{
-public:
-	virtual void done()
-	{
-		// We need to find landmarks in all folders, so get the main
-		// background download going.
-		gInventory.startBackgroundFetch();
-		gInventory.removeObserver(this);
-		delete this;
-	}
-};
-
 // static
 void LLFloaterWorldMap::show(void*, BOOL center_on_target)
 {
@@ -351,7 +337,6 @@ void LLFloaterWorldMap::show(void*, BOOL center_on_target)
 		LLFirstUse::useMap();
 
 		// Start speculative download of landmarks
-		LLInventoryFetchDescendentsObserver::folder_ref_t folders;
 		LLUUID landmark_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_LANDMARK);
 		gInventory.startBackgroundFetch(landmark_folder_id);
 
diff --git a/indra/newview/llfolderview.cpp b/indra/newview/llfolderview.cpp
index 38f224932966725792246a0ea34378d1a62a00f5..a68b937093ac0433c474e788c4bdebc2ed00670f 100644
--- a/indra/newview/llfolderview.cpp
+++ b/indra/newview/llfolderview.cpp
@@ -3678,6 +3678,14 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask, BOOL called_from_parent )
 {
 	BOOL handled = FALSE;
 
+	// SL-51858: Key presses are not being passed to the Popup menu.
+	// A proper fix is non-trivial so instead just close the menu.
+	LLMenuGL* menu = (LLMenuGL*)LLView::getViewByHandle(mPopupMenuHandle);
+	if (menu->isOpen())
+	{
+		LLMenuGL::sMenuContainer->hideMenus();
+	}
+
 	LLView *item = NULL;
 	if (getChildCount() > 0)
 	{
diff --git a/indra/newview/llgroupmgr.cpp b/indra/newview/llgroupmgr.cpp
index 7d7a5b9a3a01fc07fa9baabc32b644be0dce25b2..d1116b66e1b11b05f3e336d4cf602f7fbd63751e 100644
--- a/indra/newview/llgroupmgr.cpp
+++ b/indra/newview/llgroupmgr.cpp
@@ -780,7 +780,10 @@ void LLGroupMgr::removeObserver(LLGroupMgrObserver* observer)
 			mObservers.erase(it);
 			break;
 		}
-		++it;
+		else
+		{
+			++it;
+		}
 	}
 }
 
@@ -1287,6 +1290,7 @@ void LLGroupMgr::processCreateGroupReply(LLMessageSystem* msg, void ** data)
 LLGroupMgrGroupData* LLGroupMgr::createGroupData(const LLUUID& id)
 {
 	LLGroupMgrGroupData* group_datap;
+
 	group_iter existing_group = gGroupMgr->mGroups.find(id);
 	if (existing_group == gGroupMgr->mGroups.end())
 	{
@@ -1320,7 +1324,6 @@ void LLGroupMgr::notifyObservers(LLGroupChange gc)
 
 void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap)
 {
-	mGroups[group_datap->getID()] = group_datap;
 	if (mGroups.size() > MAX_CACHED_GROUPS)
 	{
 		// get rid of groups that aren't observed
@@ -1330,8 +1333,8 @@ void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap)
 			if (oi == mObservers.end())
 			{
 				// not observed
-				LLGroupMgrGroupData* group_datap = gi->second;
-				delete group_datap;
+				LLGroupMgrGroupData* unobserved_groupp = gi->second;
+				delete unobserved_groupp;
 				mGroups.erase(gi++);
 			}
 			else
@@ -1340,6 +1343,7 @@ void LLGroupMgr::addGroup(LLGroupMgrGroupData* group_datap)
 			}
 		}
 	}
+	mGroups[group_datap->getID()] = group_datap;
 }
 
 
diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp
index 4e9c399f3ea963b96f93b4a634dea104c4389041..505364f98cd8476ee296b3ee431ddf9a26533508 100644
--- a/indra/newview/llinventorybridge.cpp
+++ b/indra/newview/llinventorybridge.cpp
@@ -1784,8 +1784,14 @@ void LLFolderBridge::folderOptionsMenu()
 		checkFolderForContentsOfType(model, is_gesture) )
 	{
 		mItems.push_back("Folder Wearables Separator");
-		mItems.push_back("Add To Outfit");
-		mItems.push_back("Replace Outfit");
+
+		// Only enable add/replace outfit for non-default folders.
+		const LLInventoryCategory* category = model->getCategory(mUUID);
+		if (!category || (LLAssetType::AT_NONE == category->getPreferredType()))
+		{
+			mItems.push_back("Add To Outfit");
+			mItems.push_back("Replace Outfit");
+		}
 		mItems.push_back("Take Off Items");
 	}
 	hideContextEntries(*mMenu, mItems, disabled_items);
diff --git a/indra/newview/llpanelgroup.cpp b/indra/newview/llpanelgroup.cpp
index f3e9eaf2fe8fe9f289d5db72adc0d992fac968b8..a96b66984b4e3da9de99fc82482dfce0bf79e0dd 100644
--- a/indra/newview/llpanelgroup.cpp
+++ b/indra/newview/llpanelgroup.cpp
@@ -168,11 +168,11 @@ LLPanelGroup::LLPanelGroup(const std::string& filename,
 	mFactoryMap["roles_sub_tab"] = LLCallbackMap(LLPanelGroupRolesSubTab::createTab, &mID);
 	mFactoryMap["actions_sub_tab"] = LLCallbackMap(LLPanelGroupActionsSubTab::createTab, &mID);
 
+	gGroupMgr->addObserver(this);
+
 	// Pass on construction of this panel to the control factory.
 	gUICtrlFactory->buildPanel(this, filename, &getFactoryMap());
 	mFilename = filename;
-
-	gGroupMgr->addObserver(this);
 }
 
 LLPanelGroup::~LLPanelGroup()
diff --git a/indra/newview/llpreviewgesture.cpp b/indra/newview/llpreviewgesture.cpp
index a9205998e63a8ac3d6d2811e3e9572353c192237..720963cb0f5f30f294baf1cc9049facdcc8856a9 100644
--- a/indra/newview/llpreviewgesture.cpp
+++ b/indra/newview/llpreviewgesture.cpp
@@ -151,6 +151,13 @@ LLPreviewGesture* LLPreviewGesture::show(const std::string& title, const LLUUID&
 		hostp->addFloater(self, TRUE);
 	}
 
+	// Start speculative download of sounds and animations
+	LLUUID animation_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_ANIMATION);
+	gInventory.startBackgroundFetch(animation_folder_id);
+
+	LLUUID sound_folder_id = gInventory.findCategoryUUIDForType(LLAssetType::AT_SOUND);
+	gInventory.startBackgroundFetch(sound_folder_id);
+
 	// this will call refresh when we have everything.
 	LLViewerInventoryItem* item = (LLViewerInventoryItem*)self->getItem();
 	if(item && !item->isComplete())
@@ -577,8 +584,10 @@ void LLPreviewGesture::addAnimations()
 	LLComboBox* combo = mAnimationCombo;
 
 	combo->removeall();
+	
+	LLString none_text = childGetText("none_text");
 
-	combo->add("-- None --", LLUUID::null);
+	combo->add(none_text, LLUUID::null);
 
 	// Add all the default (legacy) animations
 	S32 i;
@@ -628,6 +637,13 @@ void LLPreviewGesture::addAnimations()
 
 void LLPreviewGesture::addSounds()
 {
+	LLComboBox* combo = mSoundCombo;
+	combo->removeall();
+	
+	LLString none_text = childGetText("none_text");
+
+	combo->add(none_text, LLUUID::null);
+
 	// Get all inventory items that are sounds
 	LLViewerInventoryCategory::cat_array_t cats;
 	LLViewerInventoryItem::item_array_t items;
@@ -655,8 +671,6 @@ void LLPreviewGesture::addSounds()
 	std::sort(sounds.begin(), sounds.end(), SortItemPtrsByName());
 
 	// And load up the combobox
-	LLComboBox* combo = mSoundCombo;
-	combo->removeall();
 	std::vector<LLInventoryItem*>::iterator it;
 	for (it = sounds.begin(); it != sounds.end(); ++it)
 	{
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index af16a4d3fa2ca969d9e88968b5e47396ef6b0ead..d48fa405baa9b1490111b282c236f5de0e6b38dc 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -3272,7 +3272,6 @@ void LLSelectMgr::deselectAll()
 	mLastSentSelectionCenterGlobal.clearVec();
 
 	updatePointAt();
-	updateSelectionCenter();
 }
 
 void LLSelectMgr::deselectUnused()
@@ -5302,11 +5301,8 @@ void LLSelectMgr::updateSelectionCenter()
 		mShowSelection = FALSE;
 		mSelectionBBox = LLBBox(); 
 		mPauseRequest = NULL;
-		if (gAgent.getAvatarObject())
-		{
-			gAgent.getAvatarObject()->mHUDTargetZoom = 1.f;
-			gAgent.getAvatarObject()->mHUDCurZoom = 1.f;
-		}
+		resetAgentHUDZoom();
+
 	}
 	else
 	{
@@ -5604,6 +5600,33 @@ BOOL LLSelectMgr::setForceSelection(BOOL force)
 	return force; 
 }
 
+void LLSelectMgr::resetAgentHUDZoom()
+{
+	if (gAgent.getAvatarObject())
+	{
+		gAgent.getAvatarObject()->mHUDTargetZoom = 1.f;
+		gAgent.getAvatarObject()->mHUDCurZoom = 1.f;
+	}
+}
+
+void LLSelectMgr::getAgentHUDZoom(F32 &target_zoom, F32 &current_zoom) const
+{
+	if (gAgent.getAvatarObject())
+	{
+		target_zoom = gAgent.getAvatarObject()->mHUDTargetZoom;
+		current_zoom = gAgent.getAvatarObject()->mHUDCurZoom;
+	}
+}
+
+void LLSelectMgr::setAgentHUDZoom(F32 target_zoom, F32 current_zoom)
+{
+	if (gAgent.getAvatarObject())
+	{
+		gAgent.getAvatarObject()->mHUDTargetZoom = target_zoom;
+		gAgent.getAvatarObject()->mHUDCurZoom = current_zoom;
+	}
+}
+
 LLObjectSelection::LLObjectSelection() : 
 	LLRefCount(),
 	mSelectType(SELECT_TYPE_WORLD)
diff --git a/indra/newview/llselectmgr.h b/indra/newview/llselectmgr.h
index 69bf5850051a25e2e92fa67a6d30d1f2163e0134..26b919ba28a2275c0d4f92ff94255aee87d5e553 100644
--- a/indra/newview/llselectmgr.h
+++ b/indra/newview/llselectmgr.h
@@ -602,7 +602,12 @@ class LLSelectMgr : public LLEditMenuHandler
 
 	LLVector3d		getSelectionCenterGlobal() const	{ return mSelectionCenterGlobal; }
 	void			updateSelectionCenter();
-	void			updatePointAt();
+
+	void resetAgentHUDZoom();
+	void setAgentHUDZoom(F32 target_zoom, F32 current_zoom);
+	void getAgentHUDZoom(F32 &target_zoom, F32 &current_zoom) const;
+
+	void updatePointAt();
 
 	// Internal list maintenance functions. TODO: Make these private!
 	void remove(std::vector<LLViewerObject*>& objects);
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 4ade8c57ff6cb08dc3e40681c9219b8c1df93537..a84590f4dfcbc723ba0e1e44ffaf7e74a3f24dba 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -1078,7 +1078,17 @@ BOOL idle_startup()
 				}
 				else if (message_response)
 				{
-					emsg << message_response;
+					// XUI: fix translation for strings returned during login
+					// We need a generic table for translations
+					LLString big_reason = LLAgent::sTeleportErrorMessages[ message_response ];
+					if ( big_reason.size() == 0 )
+					{
+						emsg << message_response;
+					}
+					else
+					{
+						emsg << big_reason;
+					}
 				}
 
 				if(reason_response && (0 == strcmp(reason_response, "tos")))
@@ -3099,67 +3109,6 @@ void init_stat_view()
 	stat_barp->mDisplayBar = FALSE;
 
 
-	// Pipeline statistics
-	LLStatView *pipeline_statviewp;
-	pipeline_statviewp = new LLStatView("pipeline stat view", "Pipeline", "", rect);
-	render_statviewp->addChildAtEnd(pipeline_statviewp);
-
-	stat_barp = pipeline_statviewp->addStat("Visible Drawables", &(gPipeline.mNumVisibleDrawablesStat));
-	stat_barp->setUnitLabel("");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 10000.f;
-	stat_barp->mTickSpacing = 1000.f;
-	stat_barp->mLabelSpacing = 5000.f;
-	stat_barp->mPerSec = FALSE;
-
-	stat_barp = pipeline_statviewp->addStat("Visible Faces", &(gPipeline.mNumVisibleFacesStat));
-	stat_barp->setUnitLabel("");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 40000.f;
-	stat_barp->mTickSpacing = 5000.f;
-	stat_barp->mLabelSpacing = 10000.f;
-	stat_barp->mPerSec = FALSE;
-
-	stat_barp = pipeline_statviewp->addStat("DirtyGeom", &(gPipeline.mGeometryChangesStat));
-	stat_barp->setUnitLabel("/fr");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 1000.f;
-	stat_barp->mTickSpacing = 100.f;
-	stat_barp->mLabelSpacing = 500.f;
-	stat_barp->mPerSec = FALSE;
-
-	stat_barp = pipeline_statviewp->addStat("DirtyLight", &(gPipeline.mLightingChangesStat));
-	stat_barp->setUnitLabel("/fr");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 1000.f;
-	stat_barp->mTickSpacing = 100.f;
-	stat_barp->mLabelSpacing = 500.f;
-	stat_barp->mPerSec = FALSE;
-
-	stat_barp = pipeline_statviewp->addStat("MoveList", &(gPipeline.mMoveChangesStat));
-	stat_barp->setUnitLabel("dr");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 1000.f;
-	stat_barp->mTickSpacing = 100.f;
-	stat_barp->mLabelSpacing = 500.f;
-	stat_barp->mPerSec = FALSE;
-
-	stat_barp = pipeline_statviewp->addStat("Compiles", &(gPipeline.mCompilesStat));
-	stat_barp->setUnitLabel("/fr");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 1000.f;
-	stat_barp->mTickSpacing = 100.f;
-	stat_barp->mLabelSpacing = 500.f;
-	stat_barp->mPerSec = FALSE;
-
-	stat_barp = pipeline_statviewp->addStat("Verts Relit", &(gPipeline.mVerticesRelitStat));
-	stat_barp->setUnitLabel("/fr");
-	stat_barp->mMinBar = 0.f;
-	stat_barp->mMaxBar = 40000.f;
-	stat_barp->mTickSpacing = 10000.f;
-	stat_barp->mLabelSpacing = 20000.f;
-	stat_barp->mPerSec = FALSE;
-
 	// Texture statistics
 	LLStatView *texture_statviewp;
 	texture_statviewp = new LLStatView("texture stat view", "Texture", "", rect);
diff --git a/indra/newview/lltoolselect.cpp b/indra/newview/lltoolselect.cpp
index d366226a058edc90d0a9ea9bd932db96848e6f31..f77202f1bca2b945c91483d685021e4c5c984d86 100644
--- a/indra/newview/lltoolselect.cpp
+++ b/indra/newview/lltoolselect.cpp
@@ -155,6 +155,11 @@ LLHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObject *
 		}
 		else
 		{
+			// Save the current zoom values because deselect resets them.
+			F32 target_zoom;
+			F32 current_zoom;
+			gSelectMgr->getAgentHUDZoom(target_zoom, current_zoom);
+
 			// JC - Change behavior to make it easier to select children
 			// of linked sets. 9/3/2002
 			if( !already_selected || ignore_group)
@@ -171,6 +176,9 @@ LLHandle<LLObjectSelection> LLToolSelect::handleObjectSelection(LLViewerObject *
 			{
 				gSelectMgr->selectObjectAndFamily(object);
 			}
+
+			// restore the zoom to the previously stored values.
+			gSelectMgr->setAgentHUDZoom(target_zoom, current_zoom);
 		}
 
 		if (!gAgent.getFocusOnAvatar() &&										// if camera not glued to avatar
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index d336876ee119224d65640a49c645bb3bdf6ce9bc..758455df6ae4df0445db9e2b435597be6e1e4ea3 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -748,13 +748,7 @@ U32 LLPipeline::addObject(LLViewerObject *vobj)
 
 void LLPipeline::resetFrameStats()
 {
-	mCompilesStat.addValue(sCompiles);
-	mLightingChangesStat.addValue(mLightingChanges);
-	mGeometryChangesStat.addValue(mGeometryChanges);
 	mTrianglesDrawnStat.addValue(mTrianglesDrawn/1000.f);
-	mVerticesRelitStat.addValue(mVerticesRelit);
-	mNumVisibleFacesStat.addValue(mNumVisibleFaces);
-	mNumVisibleDrawablesStat.addValue((S32)mVisibleList.size());
 
 	mTrianglesDrawn = 0;
 	sCompiles        = 0;
@@ -856,8 +850,6 @@ void LLPipeline::updateMove()
 		return;
 	}
 
-	mMoveChangesStat.addValue((F32)mMovedList.size());
-
 	for (LLDrawable::drawable_set_t::iterator iter = mRetexturedList.begin();
 		 iter != mRetexturedList.end(); ++iter)
 	{
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 583f40e93d2d3e7a80a5ef990e8f2d0ae6a4fb93..8b64b630161a132bc3a3c13419834dc8c8c0ae29 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -349,19 +349,12 @@ class LLPipeline
 	BOOL					 mBackfaceCull;
 	S32						 mTrianglesDrawn;
 	LLStat                   mTrianglesDrawnStat;
-	LLStat					 mCompilesStat;
 	S32						 mVerticesRelit;
-	LLStat					 mVerticesRelitStat;
 
 	S32						 mLightingChanges;
-	LLStat					 mLightingChangesStat;
 	S32						 mGeometryChanges;
-	LLStat					 mGeometryChangesStat;
-	LLStat					 mMoveChangesStat;
 
 	S32						 mNumVisibleFaces;
-	LLStat					 mNumVisibleFacesStat;
-	LLStat					 mNumVisibleDrawablesStat;
 
 	static S32				sCompiles;