Index: trunk/nv/common.hh
===================================================================
--- trunk/nv/common.hh	(revision 110)
+++ trunk/nv/common.hh	(revision 111)
@@ -193,5 +193,5 @@
 	if (p == 0)
 	{
-		NV_THROW( std::bad_cast, "dynamic_cast returned NULL" );
+		NV_THROW( std::bad_cast );
 	}
 
Index: trunk/nv/interface/clear_state.hh
===================================================================
--- trunk/nv/interface/clear_state.hh	(revision 110)
+++ trunk/nv/interface/clear_state.hh	(revision 111)
@@ -27,5 +27,5 @@
 		bool alpha;
 
-		color_mask() : red( true ), blue( true ), green( true ), alpha( true ) {}
+		color_mask() : red( true ), green( true ), blue( true ), alpha( true ) {}
 		color_mask( bool red, bool green, bool blue, bool alpha )
 			: red( red ), green( green ), blue( blue ), alpha( alpha ) {}
Index: trunk/nv/interface/mesh.hh
===================================================================
--- trunk/nv/interface/mesh.hh	(revision 110)
+++ trunk/nv/interface/mesh.hh	(revision 111)
@@ -107,5 +107,5 @@
 		vertex_attribute<T>* get_indices() 
 		{
-			return m_indices->get_type() == type_to_enum<T>() ? ((vertex_attribute<T>*)(m_indices)); : nullptr; 
+			return m_indices->get_type() == type_to_enum<T>() ? ((vertex_attribute<T>*)(m_indices)) : nullptr; 
 		}
 
Index: trunk/nv/interface/program.hh
===================================================================
--- trunk/nv/interface/program.hh	(revision 110)
+++ trunk/nv/interface/program.hh	(revision 111)
@@ -61,8 +61,8 @@
 	{
 	public:
-		typename T value_type;
+		typedef T value_type;
 
 		uniform( const string& name, int location, int length ) 
-			: uniform_base( name, type_to_enum< typename T >::type, location, length ), m_value()
+			: uniform_base( name, type_to_enum< T >::type, location, length ), m_value()
 		{}
 
Index: trunk/nv/interface/vertex_buffer.hh
===================================================================
--- trunk/nv/interface/vertex_buffer.hh	(revision 110)
+++ trunk/nv/interface/vertex_buffer.hh	(revision 111)
@@ -39,4 +39,5 @@
 		int get_size() const { return m_size; };
 		buffer_hint get_hint() const { return m_hint; };
+        virtual ~buffer() {}
 	protected:
 		int         m_size;
Index: trunk/nv/interface/window.hh
===================================================================
--- trunk/nv/interface/window.hh	(revision 110)
+++ trunk/nv/interface/window.hh	(revision 111)
@@ -33,5 +33,5 @@
 		virtual void swap_buffers() = 0;
 		virtual device* get_device() = 0;
-		virtual ~window() = 0 {};
+		virtual ~window() {};
 	};
 
Index: trunk/nv/types.hh
===================================================================
--- trunk/nv/types.hh	(revision 110)
+++ trunk/nv/types.hh	(revision 111)
@@ -162,4 +162,15 @@
 	};
 
+	template <typename TYPE> void ConstructObject(void* object)
+	{
+		// Use placement new to call the constructor
+		new (object) TYPE;
+	}
+	template <typename TYPE> void DestructObject(void* object)
+	{
+		// Explicit call of the destructor
+		((TYPE*)object)->TYPE::~TYPE();
+	}
+    
 	struct type_entry;
 
@@ -256,22 +267,9 @@
 		std::vector<type_enum> enum_list;
 
-		template <int TYPE>
-		type_entry& base()
-		{
-			base_type = type_db->get_type( typeid(TYPE) );
-		}
+		template <typename TYPE>
+		type_entry& base();
 
 		template <int SIZE>
-		type_entry& fields( type_field (&init_fields)[SIZE] )
-		{
-			for (int i = 0; i < SIZE; i++)
-			{
-				type_field f = init_fields[i];
-				f.type = type_db->get_type(*(f.type_inf));
-				f.type_name = f.type->name;
-				field_list.push_back(f);
-			}
-			return *this;
-		}
+		type_entry& fields( type_field (&init_fields)[SIZE] );
 
 		template <int SIZE>
@@ -342,15 +340,23 @@
 		type_info_map m_idx_types;
 	};
-
-	template <typename TYPE> void ConstructObject(void* object)
-	{
-		// Use placement new to call the constructor
-		new (object) TYPE;
-	}
-	template <typename TYPE> void DestructObject(void* object)
-	{
-		// Explicit call of the destructor
-		((TYPE*)object)->TYPE::~TYPE();
-	}
+    
+    template < typename TYPE >
+    type_entry& type_entry::base()
+    {
+        base_type = type_db->get_type( typeid(TYPE) );
+    }
+    
+    template <int SIZE>
+    type_entry& type_entry::fields( type_field (&init_fields)[SIZE] )
+    {
+        for (int i = 0; i < SIZE; i++)
+        {
+            type_field f = init_fields[i];
+            f.type = type_db->get_type(*(f.type_inf));
+            f.type_name = f.type->name;
+            field_list.push_back(f);
+        }
+        return *this;
+    }
 
 }
