Index: trunk/src/lua/lua_proxy.cc
===================================================================
--- trunk/src/lua/lua_proxy.cc	(revision 540)
+++ trunk/src/lua/lua_proxy.cc	(revision 541)
@@ -96,5 +96,5 @@
 
 nv::lua::temporary_proxy::temporary_proxy( state* state )
-	: stack_proxy( state, -1 )
+	: stack_proxy( state, lua_gettop( *state ) )
 {
 
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 540)
+++ trunk/src/lua/lua_state.cc	(revision 541)
@@ -153,5 +153,5 @@
 		// TODO : error handling
 	}
-	m_index = -1;
+	m_index = nlua_absindex( m_state, -1 );
 }
 
@@ -166,10 +166,10 @@
 		// TODO : error handling
 	}
-	m_index = -1;
+	m_index = nlua_absindex( m_state, -1 );
 }
 
 lua::table_guard::~table_guard()
 {
-	if ( m_index == -1 )
+	if ( m_level != lua_gettop( m_state ) )
 		lua_settop( m_state, m_level );
 }
@@ -184,5 +184,5 @@
 {
 	m_level = lua_gettop( m_state );
-	m_index = proxy.m_index;
+	m_index = nlua_absindex( m_state, proxy.m_index );
 }
 
