diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 0e2828332ead2b9d556aadbea3b743fcb3da4be5..6ca35684d968bbabb6e356d08096a67370fb17c8 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -2068,8 +2068,12 @@ bool LLAppViewer::cleanup()
 	//MUST happen AFTER SUBSYSTEM_CLEANUP(LLCurl)
 	delete sTextureCache;
     sTextureCache = NULL;
-	delete sTextureFetch;
-    sTextureFetch = NULL;
+    if (sTextureFetch)
+    {
+        sTextureFetch->shutdown();
+        delete sTextureFetch;
+        sTextureFetch = NULL;
+    }
 	delete sImageDecodeThread;
     sImageDecodeThread = NULL;
 	delete mFastTimerLogThread;
diff --git a/indra/newview/llreflectionmapmanager.cpp b/indra/newview/llreflectionmapmanager.cpp
index b285cc531ec987051434894750076adab38ef685..d349b7e0242a0bd5993e8862bfe1e0e2ff584aca 100644
--- a/indra/newview/llreflectionmapmanager.cpp
+++ b/indra/newview/llreflectionmapmanager.cpp
@@ -166,7 +166,7 @@ void LLReflectionMapManager::update()
 
         if (realtime && 
             closestDynamic == nullptr && 
-            probe->mCubeArray.notNull() &&
+            probe->mCubeIndex != -1 &&
             probe->getIsDynamic())
         {
             closestDynamic = probe;
@@ -324,6 +324,7 @@ S32 LLReflectionMapManager::allocateCubeIndex()
         {
             S32 ret = mProbes[i]->mCubeIndex;
             mProbes[i]->mCubeIndex = -1;
+            mProbes[i]->mCubeArray = nullptr;
             return ret;
         }
     }
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index 0c23214b521bc842592e433eca589cbfeca3dcee..62e5fedb7dc67f4199a5d24250a796536e46394d 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -78,7 +78,7 @@ LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sSmokeImagep = NULL;
 LLPointer<LLViewerFetchedTexture> LLViewerFetchedTexture::sFlatNormalImagep = NULL;
 LLViewerMediaTexture::media_map_t LLViewerMediaTexture::sMediaMap;
 LLTexturePipelineTester* LLViewerTextureManager::sTesterp = NULL;
-F32 LLViewerFetchedTexture::sMaxVirtualSize = F32_MAX/2.f;
+F32 LLViewerFetchedTexture::sMaxVirtualSize = 8192.f*8192.f;
 
 const std::string sTesterName("TextureTester");
 
@@ -99,7 +99,6 @@ U32 LLViewerTexture::sMinLargeImageSize = 65536; //256 * 256.
 U32 LLViewerTexture::sMaxSmallImageSize = MAX_CACHED_RAW_IMAGE_AREA;
 bool LLViewerTexture::sFreezeImageUpdates = false;
 F32 LLViewerTexture::sCurrentTime = 0.0f;
-F32  LLViewerTexture::sTexelPixelRatio = 1.0f;
 
 LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF;
 
@@ -809,7 +808,7 @@ void LLViewerTexture::addTextureStats(F32 virtual_size, BOOL needs_gltexture) co
 		mNeedsGLTexture = TRUE;
 	}
 
-	virtual_size *= sTexelPixelRatio;
+    llassert(virtual_size <= LLViewerFetchedTexture::sMaxVirtualSize);
 
 	if (virtual_size > mMaxVirtualSize)
 	{
diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h
index 5893f549d023ad80284a827f432260a11369bd53..a57886ff6fcbe7c1fdeb1b201b4d28b4b0510f45 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -218,7 +218,6 @@ class LLViewerTexture : public LLGLTexture
 	LL::WorkQueue::weak_t mMainQueue;
 	LL::WorkQueue::weak_t mImageQueue;
 
-	static F32 sTexelPixelRatio;
 public:
 	static const U32 sCurrentFileVersion;	
 	static S32 sImageCount;