diff --git a/indra/llmath/CMakeLists.txt b/indra/llmath/CMakeLists.txt
index ea58765b895a4ac081023e650c451ef629a3e43f..dd13d8acd3de8256c8eba7075ec78febecf6d31c 100644
--- a/indra/llmath/CMakeLists.txt
+++ b/indra/llmath/CMakeLists.txt
@@ -84,7 +84,9 @@ add_library (llmath ${llmath_SOURCE_FILES})
 
 # Add tests
 include(LLAddBuildTest)
+# UNIT TESTS
 SET(llmath_TEST_SOURCE_FILES
+  llbboxlocal.cpp
   llrect.cpp
   v2math.cpp
   v3color.cpp
@@ -92,10 +94,10 @@ SET(llmath_TEST_SOURCE_FILES
   )
 LL_ADD_PROJECT_UNIT_TESTS(llmath "${llmath_TEST_SOURCE_FILES}")
 
+# INTEGRATION TESTS
 set(test_libs llmath llcommon ${LLCOMMON_LIBRARIES} ${WINDOWS_LIBRARIES})
 # TODO: Some of these need refactoring to be proper Unit tests rather than Integration tests.
 LL_ADD_INTEGRATION_TEST(llbbox llbbox.cpp "${test_libs}")
-LL_ADD_INTEGRATION_TEST(llbboxlocal llbboxlocal.cpp "${test_libs}")
 LL_ADD_INTEGRATION_TEST(mathmisc "" "${test_libs}")
 LL_ADD_INTEGRATION_TEST(llquaternion llquaternion.cpp "${test_libs}")
 LL_ADD_INTEGRATION_TEST(v3dmath v3dmath.cpp "${test_libs}")
diff --git a/indra/llmath/m4math.cpp b/indra/llmath/m4math.cpp
index 59a0bc23350d80547599acc48285a2522fda2131..d8e7b4aaf9c4f917bf6213c8c3b142a7e060cc59 100644
--- a/indra/llmath/m4math.cpp
+++ b/indra/llmath/m4math.cpp
@@ -678,32 +678,6 @@ LLVector4 operator*(const LLMatrix4 &a, const LLVector4 &b)
 }
 */
 
-// Operates "to the left" on row-vector a
-//
-// This used to be in the header file but was not actually inlined in practice.
-// When avatar vertex programs are off, this function is a hot spot in profiles
-// due to software skinning in LLViewerJointMesh::updateGeometry().  JC
-LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b)
-{
-	// This is better than making a temporary LLVector3.  This eliminates an
-	// unnecessary LLVector3() constructor and also helps the compiler to
-	// realize that the output floats do not alias the input floats, hence
-	// eliminating redundant loads of a.mV[0], etc.  JC
-	return LLVector3(a.mV[VX] * b.mMatrix[VX][VX] + 
-					 a.mV[VY] * b.mMatrix[VY][VX] + 
-					 a.mV[VZ] * b.mMatrix[VZ][VX] +
-					 b.mMatrix[VW][VX],
-					 
-					 a.mV[VX] * b.mMatrix[VX][VY] + 
-					 a.mV[VY] * b.mMatrix[VY][VY] + 
-					 a.mV[VZ] * b.mMatrix[VZ][VY] +
-					 b.mMatrix[VW][VY],
-					 
-					 a.mV[VX] * b.mMatrix[VX][VZ] + 
-					 a.mV[VY] * b.mMatrix[VY][VZ] + 
-					 a.mV[VZ] * b.mMatrix[VZ][VZ] +
-					 b.mMatrix[VW][VZ]);
-}
 
 LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b)
 {
diff --git a/indra/llmath/m4math.h b/indra/llmath/m4math.h
index 58c9c09d7fb0735acdc31c8f853e961b7138a4c2..e74b7afe9bd9bf99befc4992c58b0440bf198123 100644
--- a/indra/llmath/m4math.h
+++ b/indra/llmath/m4math.h
@@ -230,7 +230,7 @@ class LLMatrix4
 
 //	friend inline LLMatrix4 operator*(const LLMatrix4 &a, const LLMatrix4 &b);		// Return a * b
 	friend LLVector4 operator*(const LLVector4 &a, const LLMatrix4 &b);		// Return transform of vector a by matrix b
-	friend LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b);		// Return full transform of a by matrix b
+	friend const LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b);		// Return full transform of a by matrix b
 	friend LLVector4 rotate_vector(const LLVector4 &a, const LLMatrix4 &b);	// Rotates a but does not translate
 	friend LLVector3 rotate_vector(const LLVector3 &a, const LLMatrix4 &b);	// Rotates a but does not translate
 
@@ -353,7 +353,31 @@ inline const LLMatrix4& operator-=(LLMatrix4 &a, const LLMatrix4 &b)
 	return a;
 }
 
-#endif
-
+// Operates "to the left" on row-vector a
+//
+// When avatar vertex programs are off, this function is a hot spot in profiles
+// due to software skinning in LLViewerJointMesh::updateGeometry().  JC
+inline const LLVector3 operator*(const LLVector3 &a, const LLMatrix4 &b)
+{
+	// This is better than making a temporary LLVector3.  This eliminates an
+	// unnecessary LLVector3() constructor and also helps the compiler to
+	// realize that the output floats do not alias the input floats, hence
+	// eliminating redundant loads of a.mV[0], etc.  JC
+	return LLVector3(a.mV[VX] * b.mMatrix[VX][VX] + 
+					 a.mV[VY] * b.mMatrix[VY][VX] + 
+					 a.mV[VZ] * b.mMatrix[VZ][VX] +
+					 b.mMatrix[VW][VX],
+					 
+					 a.mV[VX] * b.mMatrix[VX][VY] + 
+					 a.mV[VY] * b.mMatrix[VY][VY] + 
+					 a.mV[VZ] * b.mMatrix[VZ][VY] +
+					 b.mMatrix[VW][VY],
+					 
+					 a.mV[VX] * b.mMatrix[VX][VZ] + 
+					 a.mV[VY] * b.mMatrix[VY][VZ] + 
+					 a.mV[VZ] * b.mMatrix[VZ][VZ] +
+					 b.mMatrix[VW][VZ]);
+}
 
+#endif
 
diff --git a/indra/llmath/v3math.cpp b/indra/llmath/v3math.cpp
index f392ac448bac5b4d67a0250809dc2e0604387493..63683ed49622ba053059e3e5ae6971784337cc40 100644
--- a/indra/llmath/v3math.cpp
+++ b/indra/llmath/v3math.cpp
@@ -185,14 +185,6 @@ void 	LLVector3::snap(S32 sig_digits)
 	mV[VZ] = snap_to_sig_figs(mV[VZ], sig_digits);
 }
 
-
-std::ostream& operator<<(std::ostream& s, const LLVector3 &a) 
-{
-	s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << " }";
-	return s;
-}
-
-
 const LLVector3&	LLVector3::rotVec(const LLMatrix3 &mat)
 {
 	*this = *this * mat;
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index 06a4f5c542daf822454874b7d054319401022959..73738cffd25cdf3a4b053fad6ade6657179326e9 100644
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -556,4 +556,10 @@ inline BOOL are_parallel(const LLVector3 &a, const LLVector3 &b, F32 epsilon)
 	return FALSE;
 }
 
+inline std::ostream& operator<<(std::ostream& s, const LLVector3 &a) 
+{
+	s << "{ " << a.mV[VX] << ", " << a.mV[VY] << ", " << a.mV[VZ] << " }";
+	return s;
+}
+
 #endif