Index: trunk/nv/lua/lua_state.hh
===================================================================
--- trunk/nv/lua/lua_state.hh	(revision 85)
+++ trunk/nv/lua/lua_state.hh	(revision 86)
@@ -30,4 +30,5 @@
 		public:
 			stack_guard( state* L );
+			stack_guard( state& L );
 			int get_level() const { return m_level; }
 			~stack_guard();
@@ -61,6 +62,6 @@
 			friend class table_guard;
 		public:
-			state( bool load_libs = false );
-			state( lua_State* state );
+			explicit state( bool load_libs = false );
+			explicit state( lua_State* state );
 			bool do_string( const std::string& code, const std::string& name, int rvalues = 0 );
 			bool do_stream( std::istream& stream, const std::string& name );
@@ -71,4 +72,5 @@
 			reference register_object( object * o );
 			void unregister_object( object * o );
+			operator lua_State*() { return L; }
 			~state();
 		private:
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 85)
+++ trunk/src/lua/lua_state.cc	(revision 86)
@@ -17,4 +17,10 @@
 lua::stack_guard::stack_guard( lua::state* L )
 	: L(L), m_level( lua_gettop(L->L) )
+{
+
+}
+
+lua::stack_guard::stack_guard( lua::state& L )
+	: L(&L), m_level( lua_gettop((&L)->L) )
 {
 
Index: trunk/tests/lualib_test/lualib_test.cc
===================================================================
--- trunk/tests/lualib_test/lualib_test.cc	(revision 85)
+++ trunk/tests/lualib_test/lualib_test.cc	(revision 86)
@@ -28,5 +28,5 @@
 	{
 		nv::lua::state state( true );
-		nlua_register_glm( state.get_raw() );
+		nlua_register_glm( state );
 		// run the Lua script
 		state.do_file( "init.lua" );
@@ -34,5 +34,5 @@
 		for (;;)
 		{
-			nv::lua::stack_guard guard( &state );
+			nv::lua::stack_guard guard( state );
 			int stack = guard.get_level();
 			std::string input;
@@ -56,14 +56,14 @@
 			if ( !result )
 			{
-				std::string error = lua_tostring( state.get_raw(), -1 );
+				std::string error = lua_tostring( state, -1 );
 				std::cout << "ERROR : " << error << std::endl;
 				continue;
 			}
 
-			if (lua_gettop( state.get_raw() ) > stack)
+			if (lua_gettop( state ) > stack)
 			{
-				for ( int i = stack+1; i <= lua_gettop( state.get_raw() ); ++i )
+				for ( int i = stack+1; i <= lua_gettop( state ); ++i )
 				{
-					std::cout << nlua_typecontent( state.get_raw(), i ) << std::endl;
+					std::cout << nlua_typecontent( state, i ) << std::endl;
 				}
 			}
