diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp
index 052ca3be58910b87a3f6a2c599ad52686189eacd..d16c2731b3450362d5795cd00b177ec0216c8e8f 100644
--- a/indra/llcharacter/llkeyframemotion.cpp
+++ b/indra/llcharacter/llkeyframemotion.cpp
@@ -498,6 +498,7 @@ LLMotion::LLMotionInitStatus LLKeyframeMotion::onInitialize(LLCharacter *charact
 		// request asset
 		mAssetStatus = ASSET_FETCHED;
 
+        LL_DEBUGS("Animation") << "Requesting data fetch for: " << mID << LL_ENDL;
 		character_id = new LLUUID(mCharacter->getID());
 		gAssetStorage->getAssetData(mID,
 						LLAssetType::AT_ANIMATION,
@@ -2257,8 +2258,8 @@ void LLKeyframeMotion::onLoadComplete(LLVFS *vfs,
 			
 			U8* buffer = new U8[size];
 			file.read((U8*)buffer, size);	/*Flawfinder: ignore*/
-			
-			LL_DEBUGS() << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;
+
+			LL_DEBUGS("Animation") << "Loading keyframe data for: " << motionp->getName() << ":" << motionp->getID() << " (" << size << " bytes)" << LL_ENDL;
 			
 			LLDataPackerBinaryBuffer dp(buffer, size);
 			if (motionp->deserialize(dp))
diff --git a/indra/llcommon/lltracerecording.cpp b/indra/llcommon/lltracerecording.cpp
index 0b10438b9f1380da1b340fbc2c050a90c0592a14..3094b627a2f35b7ecfa8d30661196a6fbd7b4304 100644
--- a/indra/llcommon/lltracerecording.cpp
+++ b/indra/llcommon/lltracerecording.cpp
@@ -257,7 +257,13 @@ F64Kilobytes Recording::getMean(const StatType<MemAccumulator>& stat)
 	
 	if (active_accumulator && active_accumulator->mSize.hasValue())
 	{
-		return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), active_accumulator->mSize.getSampleCount() / (accumulator.mSize.getSampleCount() + active_accumulator->mSize.getSampleCount())));
+        F32 t = 0.0f;
+        S32 div = accumulator.mSize.getSampleCount() + active_accumulator->mSize.getSampleCount();
+        if (div > 0)
+        {
+            t = active_accumulator->mSize.getSampleCount() / div;
+        }
+		return F64Bytes(lerp(accumulator.mSize.getMean(), active_accumulator->mSize.getMean(), t));
 	}
 	else
 	{
@@ -426,7 +432,13 @@ F64 Recording::getMean( const StatType<SampleAccumulator>& stat )
 	const SampleAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mSamples[stat.getIndex()] : NULL;
 	if (active_accumulator && active_accumulator->hasValue())
 	{
-		return lerp(accumulator.getMean(), active_accumulator->getMean(), active_accumulator->getSampleCount() / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
+        F32 t = 0.0f;
+        S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount();
+        if (div > 0)
+        {
+            t = active_accumulator->getSampleCount() / div;
+        }
+		return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
 	}
 	else
 	{
@@ -506,7 +518,13 @@ F64 Recording::getMean( const StatType<EventAccumulator>& stat )
 	const EventAccumulator* active_accumulator = mActiveBuffers ? &mActiveBuffers->mEvents[stat.getIndex()] : NULL;
 	if (active_accumulator && active_accumulator->hasValue())
 	{
-		return lerp(accumulator.getMean(), active_accumulator->getMean(), active_accumulator->getSampleCount() / (accumulator.getSampleCount() + active_accumulator->getSampleCount()));
+		F32 t = 0.0f;
+        S32 div = accumulator.getSampleCount() + active_accumulator->getSampleCount();
+        if (div > 0)
+        {
+            t = active_accumulator->getSampleCount() / div;
+        }
+		return lerp(accumulator.getMean(), active_accumulator->getMean(), t);
 	}
 	else
 	{
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 5287f98827b9ebd688fd3f397cb95c2be6765ee4..775402df6641c7a0cca33215b08151db7335b899 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -5829,7 +5829,6 @@ void LLAppViewer::metricsUpdateRegion(U64 region_handle)
 	}
 }
 
-
 /**
  * Attempts to start a multi-threaded metrics report to be sent back to
  * the grid for consumption.
@@ -5847,6 +5846,11 @@ void LLAppViewer::metricsSend(bool enable_reporting)
 		{
 			std::string	caps_url = regionp->getCapability("ViewerMetrics");
 
+            if (gSavedSettings.getBOOL("QAModeMetrics"))
+            {
+                dump_sequential_xml("metric_asset_stats",gViewerAssetStats->asLLSD(true));
+            }
+            
 			// Make a copy of the main stats to send into another thread.
 			// Receiving thread takes ownership.
 			LLViewerAssetStats * main_stats(new LLViewerAssetStats(*gViewerAssetStats));