diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 692878c28f3761addb6b9bcbe421d20f0995196a..430ac5dcc60554d847bc541ea50adba8ef76e96f 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -6287,7 +6287,7 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 		
 		U32 buffer_count = 0;
 
-		for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(); drawable_iter != group->getDataEnd(); ++drawable_iter)
+		for (LLSpatialGroup::element_iter drawable_iter = group->getDataBegin(), drawable_iter_end = group->getDataEnd(); drawable_iter != drawable_iter_end; ++drawable_iter)
 		{
 			LLDrawable* drawablep = (LLDrawable*)(*drawable_iter)->getDrawable();
 
@@ -6352,18 +6352,18 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
 		
 		{
 			LL_RECORD_BLOCK_TIME(FTM_REBUILD_MESH_FLUSH);
-			for (LLVertexBuffer** iter = locked_buffer, ** end_iter = locked_buffer+buffer_count; iter != end_iter; ++iter)
-		{
-			(*iter)->flush();
-		}
+			for (LLVertexBuffer** iter = locked_buffer, **end_iter = locked_buffer + buffer_count; iter != end_iter; ++iter)
+			{
+				(*iter)->flush();
+			}
 
-		// don't forget alpha
-		if(group != NULL && 
-		   !group->mVertexBuffer.isNull() && 
-		   group->mVertexBuffer->isLocked())
-		{
-			group->mVertexBuffer->flush();
-		}
+			// don't forget alpha
+			if (group != NULL &&
+				group->mVertexBuffer.notNull() &&
+				group->mVertexBuffer->isLocked())
+			{
+				group->mVertexBuffer->flush();
+			}
 		}
 
 		//if not all buffers are unmapped
diff --git a/indra/newview/llwlparamset.cpp b/indra/newview/llwlparamset.cpp
index b88a2e9fc808222fcb223601651f9a4f2eb17b5c..5aaa20aabced7268bd0aed358692af4ea1d847be 100644
--- a/indra/newview/llwlparamset.cpp
+++ b/indra/newview/llwlparamset.cpp
@@ -64,9 +64,9 @@ static LLTrace::BlockTimerStatHandle FTM_WL_PARAM_UPDATE("WL Param Update");
 void LLWLParamSet::update(LLGLSLShader * shader) const 
 {	
 	LL_RECORD_BLOCK_TIME(FTM_WL_PARAM_UPDATE);
-	LLSD::map_const_iterator i = mParamValues.beginMap();
-	std::vector<LLStaticHashedString>::const_iterator n = mParamHashedNames.begin();
-	for(;(i != mParamValues.endMap()) && (n != mParamHashedNames.end());++i, n++)
+	LLSD::map_const_iterator i = mParamValues.beginMap(), i_end = mParamValues.endMap();
+	std::vector<LLStaticHashedString>::const_iterator n = mParamHashedNames.begin(), n_end = mParamHashedNames.end();
+	for(;(i != i_end) && (n != n_end); ++i, ++n)
 	{
 		const LLStaticHashedString& param = *n;