Index: trunk/src/lua/lua_map_tile.cc
===================================================================
--- trunk/src/lua/lua_map_tile.cc	(revision 380)
+++ trunk/src/lua/lua_map_tile.cc	(revision 383)
@@ -118,6 +118,6 @@
 		new_tile->ascii = new nv::uchar8[ size ];
 	}
-	std::copy( old_tile->data, old_tile->data + size, new_tile->data );
-	if ( old_tile->ascii ) std::copy( old_tile->ascii, old_tile->ascii + size, new_tile->ascii );
+	nv::raw_copy_n( old_tile->data, size, new_tile->data );
+	if ( old_tile->ascii ) nv::raw_copy_n( old_tile->ascii, size, new_tile->ascii );
 
 	luaL_getmetatable( L, NLUA_MAP_TILE_METATABLE );
@@ -237,6 +237,10 @@
 	map_tile* tile = nlua_to_pmap_tile( L, 1 );
 	// assert( tile^.ascii == nullptr );
-	std::vector< nv::uint8 > sizes_x = nlua_tobytearray( L, 2 );
-	std::vector< nv::uint8 > sizes_y = ( lua_istable( L, 3 ) ? nlua_tobytearray( L, 3 ) : sizes_x );
+	nv::vector< nv::uint8 > sizes_x = nlua_tobytearray( L, 2 );
+	nv::vector< nv::uint8 > sizes_y;
+	if ( lua_istable( L, 3 ) )
+		sizes_y = nlua_tobytearray( L, 2 );
+	else
+		sizes_y.assign( sizes_x );
 
 	nv::uint16 org_x = tile->size_x;
Index: trunk/src/lua/lua_raw.cc
===================================================================
--- trunk/src/lua/lua_raw.cc	(revision 380)
+++ trunk/src/lua/lua_raw.cc	(revision 383)
@@ -262,8 +262,8 @@
 }
 
-std::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index )
-{
-	index = lua_absindex( L, index );
-	std::vector<nv::uint8> result;
+nv::vector<nv::uint8> nlua_tobytearray( lua_State *L, int index )
+{
+	index = lua_absindex( L, index );
+	nv::vector<nv::uint8> result;
 	if ( lua_istable( L, index ) )
 	{
