Index: trunk/src/lua/lua_proxy.cc
===================================================================
--- trunk/src/lua/lua_proxy.cc	(revision 539)
+++ trunk/src/lua/lua_proxy.cc	(revision 540)
@@ -9,4 +9,5 @@
 #include "nv/lua/lua_raw.hh"
 #include "nv/lua/lua_state.hh"
+#include "nv/lua/lua_types.hh"
 
 using namespace nv;
@@ -58,4 +59,16 @@
 }
 
+bool nv::lua::stack_proxy::is_valid() const
+{
+	return !( lua_isnil( *m_state, m_index ) );
+}
+
+bool nv::lua::stack_proxy::read( const type_entry* entry, void* object ) const
+{
+	NV_ASSERT_ALWAYS( m_state->get_type_data()->get_type_database() == entry->type_db, "Type database mismatch between Lua and entry!" );
+	if ( lua_type( *m_state, m_index ) != LUA_TTABLE ) return false;
+	return nv::lua::read_rtti_type( m_state, entry, object, m_index );
+}
+
 bool nv::lua::stack_proxy::is_table() const
 {
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 539)
+++ trunk/src/lua/lua_state.cc	(revision 540)
@@ -153,4 +153,5 @@
 		// TODO : error handling
 	}
+	m_index = -1;
 }
 
@@ -165,27 +166,28 @@
 		// TODO : error handling
 	}
+	m_index = -1;
 }
 
 lua::table_guard::~table_guard()
 {
-	lua_settop( m_state, m_level );
-}
-
-nv::uint32 lua::table_guard::get_size()
-{
-	return nlua_rawlen( m_state, -1 );
-}
-
-bool lua::table_guard::has_field( string_view element )
-{
-	lua_getfield( m_state, -1, element.data() );
-	bool result = !( lua_isnil( m_state, -1 ) );
-	lua_pop( m_state, 1 );
-	return result;
+	if ( m_index == -1 )
+		lua_settop( m_state, m_level );
+}
+
+nv::uint32 lua::table_guard::size()
+{
+	return nlua_rawlen( m_state, m_index );
+}
+
+nv::lua::table_guard::table_guard( stack_proxy& proxy )
+	: state_wrapper( *proxy.m_state, proxy.m_state->m_lua_types, false ), m_parent( proxy.m_state ), m_level( 0 )
+{
+	m_level = lua_gettop( m_state );
+	m_index = proxy.m_index;
 }
 
 const nv::lua::temporary_proxy nv::lua::table_guard::operator[]( const string_view& key ) const
 {
-	lua_getfield( m_state, -1, key.data() );
+	lua_getfield( m_state, m_index, key.data() );
 	return temporary_proxy( m_parent );
 }
@@ -193,24 +195,6 @@
 const nv::lua::temporary_proxy nv::lua::table_guard::operator[]( sint32 key ) const
 {
-	lua_rawgeti( m_state, -1, key );
+	lua_rawgeti( m_state, m_index, key );
 	return temporary_proxy( m_parent );
-}
-
-bool nv::lua::table_guard::read( const string_view& element, const type_entry* entry, void* object )
-{
-	NV_ASSERT_ALWAYS( m_lua_types->get_type_database() == entry->type_db, "Type database mismatch between Lua and entry!" );
-	lua_getfield( m_state, -1, element.data() );
-	if ( lua_type( m_state, -1 ) != LUA_TTABLE )
-	{
-		lua_pop( m_state, 1 );
-		return false;
-	}
-	if ( !nv::lua::read_rtti_type( m_parent, entry, object, -1 ) )
-	{
-		lua_pop( m_state, 1 );
-		return false;
-	}
-	lua_pop( m_state, 1 );
-	return true;
 }
 
@@ -590,4 +574,16 @@
 }
 
+template < typename T >
+bool nlua_rtti_string_read( nv::lua::state* state, const type_entry*, void* object, int index )
+{
+	T* value = reinterpret_cast<T*>( object );
+	if ( lua_type( state->get_raw(), index ) == LUA_TSTRING )
+	{
+		*value = T( nlua_tostringview( state->get_raw(), index ) );
+		return true;
+	}
+	return false;
+}
+
 
 void nv::lua::type_data::insert( thash64 tid, lua_rtti_push_function p, lua_rtti_read_function r )
@@ -608,5 +604,10 @@
 	insert<nv::f32>   ( nlua_rtti_floating_push<nv::f32>,    nlua_rtti_floating_read<nv::f32> );
 	insert<nv::f64>   ( nlua_rtti_floating_push<nv::f64>,    nlua_rtti_floating_read<nv::f64> );
-//	insert<nv::sint64>( nlua_rtti_floating_push<nv::sint64>, nlua_rtti_floating_read<nv::sint64> );
+	insert<nv::shash32>  ( nullptr, nlua_rtti_string_read<nv::shash32> );
+	insert<nv::shash64>  ( nullptr, nlua_rtti_string_read<nv::shash64> );
+	insert<nv::string32> ( nullptr, nlua_rtti_string_read<nv::string32> );
+	insert<nv::string64> ( nullptr, nlua_rtti_string_read<nv::string64> );
+	insert<nv::string128>( nullptr, nlua_rtti_string_read<nv::string128> );
+	//	insert<nv::sint64>( nlua_rtti_floating_push<nv::sint64>, nlua_rtti_floating_read<nv::sint64> );
 //	insert<nv::uint64>( nlua_rtti_floating_push<nv::uint64>, nlua_rtti_floating_read<nv::uint64> );
 }
