Index: trunk/src/lua/lua_aux.cc
===================================================================
--- trunk/src/lua/lua_aux.cc	(revision 365)
+++ trunk/src/lua/lua_aux.cc	(revision 367)
@@ -7,5 +7,4 @@
 #include "nv/lua/lua_aux.hh"
 
-#include <utility>
 #include "nv/lua/lua_raw.hh"
 #include "nv/core/random.hh"
@@ -117,6 +116,6 @@
 			int arg1 = static_cast< int >( luaL_checkinteger( L, 1 ) );
 			int arg2 = static_cast< int >( luaL_checkinteger( L, 2 ) );
-			if (arg2 < arg1) std::swap( arg2, arg1 );
-			lua_pushinteger( L, nv::random::get().srange( arg1, arg2 ) );
+			int result = ( arg2 >= arg1 ? nv::random::get().srange( arg1, arg2 ) : nv::random::get().srange( arg2, arg1 ) );
+			lua_pushinteger( L, result );
 		}
 	}
Index: trunk/src/lua/lua_state.cc
===================================================================
--- trunk/src/lua/lua_state.cc	(revision 365)
+++ trunk/src/lua/lua_state.cc	(revision 367)
@@ -356,12 +356,4 @@
 }
 
-int lua::state::load_stream( std::istream& stream, string_ref name )
-{
-	NV_LOG_NOTICE( "Loading Lua stream '", name, "'");
-	return load_string( std::string(
-		(std::istreambuf_iterator<char>(stream)),
-		std::istreambuf_iterator<char>()), name );
-}
-
 int lua::state::load_file( string_ref filename )
 {
@@ -380,16 +372,4 @@
 	}
 	return do_current( name, rvalues ) == 0;
-}
-
-bool lua::state::do_stream( std::istream& stream, string_ref name )
-{
-	lua::stack_guard( this );
-	int result = load_stream(stream,name);
-	if (result)
-	{
-		NV_LOG_WARNING( "Failed to open stream ", name, ": ", lua_tostring( m_state, -1 ) );
-		return false;
-	}
-	return do_current( name ) == 0;
 }
 
