diff --git a/include/nif_math.h b/include/nif_math.h
index fe8eae69cd0ca3e329e038022e3d37451505960c..8ff3a6b6df9a7ecd0329313ec691eb6e0cb24899 100644
--- a/include/nif_math.h
+++ b/include/nif_math.h
@@ -18,7 +18,7 @@ namespace Niflib {
 #endif
 
 #ifndef _countof
-#define _countof(x) ((sizeof (x))/(sizeof((x)[0])))
+#define _countof(x) (int)((sizeof (x))/(sizeof((x)[0])))
 #endif
 
 //Forward declarations
diff --git a/src/Inertia.cpp b/src/Inertia.cpp
index af073fe2d3518b2f515f94f8dc4e60a1a48a8da1..fe51530dafb62da9e338e630b3ef0cdc0e4e3318 100644
--- a/src/Inertia.cpp
+++ b/src/Inertia.cpp
@@ -207,8 +207,6 @@ void Inertia::CalcMassPropertiesPolyhedron(const vector<Vector3>& vertices,
     Matrix33 covariance_canonical(	2.0f, 1.0f, 1.0f, 
 									1.0f, 2.0f, 1.0f, 
 									1.0f, 1.0f, 2.0f );
-    float covariance_correction = 1.0f/120.0f;
-
     vector<Matrix44> covariances;
     vector<float> masses;
     vector<Vector3> centers;
@@ -347,4 +345,4 @@ void Inertia::CombineMassProperties(
 		inertia *= inertias[i];
 	}
 
-}
\ No newline at end of file
+}
diff --git a/src/NIF_IO.cpp b/src/NIF_IO.cpp
index 7a4e0aff091aa938f8ed1755674dafce827e3abf..b70dff2434191ac569459cef232afc294bd4988e 100644
--- a/src/NIF_IO.cpp
+++ b/src/NIF_IO.cpp
@@ -408,10 +408,6 @@ void NifStream( HeaderString const & val, ostream& out, const NifInfo & info ) {
 	}
 
 	header_string << FormatVersionString(info.version);
-
-	char * byte_ver = (char*)&(info.version);
-	int int_ver[4] = { byte_ver[3], byte_ver[2], byte_ver[1], byte_ver[0] };
-
 	out << header_string.str() << "\n";
 };
 
@@ -830,6 +826,8 @@ std::streampos NifStreamBuf::seekoff(std::streamoff offset, std::ios_base::seekd
 	case std::ios_base::end:
 		pos = size - offset;
 		return (pos >= 0 && pos < size) ? (streampos(-1)) : pos;		
+        default:
+	        return streampos(-1);
 	}
 	return streampos(-1);
 }
diff --git a/src/ObjectRegistry.cpp b/src/ObjectRegistry.cpp
index c7bbf46b63a64b922d7accca571502098e96953c..573f5b44a88945e2439dc878391515e9c299b310 100644
--- a/src/ObjectRegistry.cpp
+++ b/src/ObjectRegistry.cpp
@@ -12,8 +12,6 @@ void ObjectRegistry::RegisterObject( const string & type_name, obj_factory_func
 }
 
 NiObject * ObjectRegistry::CreateObject( const string & type_name ) {
-	NiObject * object = NULL;
-
 	map<string, obj_factory_func>::iterator it;
 	it = object_map.find(type_name);
 
@@ -26,4 +24,4 @@ NiObject * ObjectRegistry::CreateObject( const string & type_name ) {
 	}
 }
 
-} //End namespace Niflib
\ No newline at end of file
+} //End namespace Niflib
diff --git a/src/niflib.cpp b/src/niflib.cpp
index 0b16e576705e0bf7382f97981bbc5a27bcc21b90..08732582c71b1a733383b4195c59ac7233d9190e 100644
--- a/src/niflib.cpp
+++ b/src/niflib.cpp
@@ -422,8 +422,7 @@ void WriteNifTree( ostream & out, list<NiObjectRef> const & roots, const NifInfo
 		types[it->second] = it->first;
 	}
 
-	unsigned version = info.version;
-	unsigned user_version = info.userVersion;
+        unsigned int version = info.version;
 
 	//--Write Header--//
 	Header header;
@@ -454,7 +453,7 @@ void WriteNifTree( ostream & out, list<NiObjectRef> const & roots, const NifInfo
 	}
 
 	// Set object sizes and accumulate string types
-	if (header.version >= VER_20_1_0_3)
+	if (version >= VER_20_1_0_3)
 	{
 		// Zero string information
 		header.maxStringLength = 0;