diff --git a/gen/obj_impl.cpp b/gen/obj_impl.cpp
index 892272e3212755d020f42eda176b6f9c4af857da..9c8ead891561abee7df4e2cc49393a966f60f976 100644
--- a/gen/obj_impl.cpp
+++ b/gen/obj_impl.cpp
@@ -6251,7 +6251,11 @@ void NiKeyframeData::InternalRead( istream& in, list<uint> & link_stack, unsigne
 
 void NiKeyframeData::InternalWrite( ostream& out, map<NiObjectRef,uint> link_map, unsigned int version, unsigned int user_version ) const {
 	AKeyedData::Write( out, link_map, version, user_version );
-	numRotationKeys = uint(quaternionKeys.size());
+	if ( rotationType == XYZ_ROTATION_KEY ) {
+		numRotationKeys = uint(xyzRotations.size());
+	} else {
+		numRotationKeys = uint(quaternionKeys.size());
+	}
 	NifStream( numRotationKeys, out, version );
 	if ( (numRotationKeys != 0) ) {
 		NifStream( rotationType, out, version );
@@ -6299,7 +6303,11 @@ void NiKeyframeData::InternalWrite( ostream& out, map<NiObjectRef,uint> link_map
 std::string NiKeyframeData::InternalAsString( bool verbose ) const {
 	stringstream out;
 	out << AKeyedData::asString();
-	numRotationKeys = uint(quaternionKeys.size());
+	if ( rotationType == XYZ_ROTATION_KEY ) {
+		numRotationKeys = uint(xyzRotations.size());
+	} else {
+		numRotationKeys = uint(quaternionKeys.size());
+	}
 	out << "  Num Rotation Keys:  " << numRotationKeys << endl;
 	if ( (numRotationKeys != 0) ) {
 		out << "    Rotation Type:  " << rotationType << endl;
diff --git a/nif_math.h b/nif_math.h
index 49224082324dfff6d516f6c2b04e28902328cae2..86a8a6a322595fa7b747aa67f60369f4a1f2c952 100644
--- a/nif_math.h
+++ b/nif_math.h
@@ -237,8 +237,6 @@ struct NIFLIB_API Vector3 {
 	// * \return This vector is returned.
 	// */
 	//Vector3 & operator*=( const Matrix44 & rh );
-
-	friend ostream & operator<<( ostream & out, const Vector3 & rh );
 };
 
 /* Stores two floating point numbers.  Used as a row of a Matrix22 */
@@ -878,6 +876,7 @@ struct NIFLIB_API Quaternion {
 
 ostream & operator<<( ostream & out, TexCoord const & val );
 ostream & operator<<( ostream & out, Triangle const & val );
+ostream & operator<<( ostream & out, Vector3 const & val );
 ostream & operator<<( ostream & out, Float2 const & val );
 ostream & operator<<( ostream & out, Matrix22 const & val );
 ostream & operator<<( ostream & out, Float3 const & val );
diff --git a/niflib.cpp b/niflib.cpp
index c64a44ff79cb0db6c4be560fdba35336019220b0..bea78575d1b42244eeca40ab588ca4afbc325ba5 100644
--- a/niflib.cpp
+++ b/niflib.cpp
@@ -153,8 +153,12 @@ vector<NiObjectRef> ReadNifList( istream & in ) {
 	cout << header.asString();
 #endif
 
-	//--Read Blocks--//
-   size_t numBlocks = header.numBlocks;
+#ifdef PRINT_OBJECT_NAMES
+	cout << endl << "Reading Objects:";
+#endif
+
+	//--Read Objects--//
+	size_t numBlocks = header.numBlocks;
 	vector<NiObjectRef> blocks( numBlocks ); //List to hold the blocks
 	list<uint> link_stack; //List to add link values to as they're read in from the file
 	string objectType;
@@ -335,9 +339,17 @@ void WriteNifTree( ostream & out, NiObjectRef const & root, unsigned int version
 	//Write header to file
 	header.Write( out );
 
+#ifdef PRINT_OBJECT_NAMES
+	cout << endl << "Writing Objects:";
+#endif
+
 	//--Write Objects--//
 	for (uint i = 0; i < objects.size(); ++i) {
 
+#ifdef PRINT_OBJECT_NAMES
+		cout << endl << i << ":  " << objects[i]->GetType().GetTypeName();
+#endif
+
 		if (version < 0x05000001) {
 			//cout << i << ":  " << objects[i]->GetType().GetTypeName() << endl;
 			//Write Block Type