Index: tol/btol/set_type/setgrainc.cpp
===================================================================
--- tol/btol/set_type/setgrainc.cpp	(revision 6eef720714c57e6a45a25c4e08786bbdd0f5d745)
+++ tol/btol/set_type/setgrainc.cpp	(revision 904521eac0de0fb8b92cd1809fd95983f50b3676)
@@ -67,4 +67,6 @@
 BList*	    BSetFromFile::compiled_     = NIL;
 BInt	      BSetFromFile::nSetFromFile_ = 0;
+BInt	      BSetFromFile::nSetFromFileGlobal_ = 0;
+
 BTerminator BSetFromFile::terminator_   = NIL;
 
@@ -284,4 +286,5 @@
   if(BGrammar::Level()==0)
   {
+    nSetFromFileGlobal_++;
     compiled_ = Cons(this, compiled_);
     DecNRefs();
@@ -312,4 +315,5 @@
   if(BGrammar::Level()==0)
   {
+    nSetFromFileGlobal_++;
     compiled_ = Cons(this, compiled_);
     DecNRefs();
@@ -336,4 +340,5 @@
   if(Level()==0)
   {
+    nSetFromFileGlobal_--;
     IncNRefs();
     compiled_=LstRemoveAtom(compiled_,this);
@@ -1831,5 +1836,4 @@
     BText expression = BText("Include(\"")+path+"\")";
     BSetFromFile* set= (BSetFromFile*)(GraSet()->EvaluateExpr(expression));
-    
     return(set);
 }
@@ -1844,4 +1848,5 @@
   static BSyntaxObject* show_msg_included_so = NULL;
   static bool show_msg_included = true;
+  int nErr0 = (int)TOLErrorNumber().Value();
   if(!show_msg_including_so)
   {
@@ -1931,4 +1936,10 @@
       Std(ok+I2(" file ", " el fichero ")+p+" ["+BDat((double)tm.MSec()/1000.0).Format("%.3lf")+" sec.]\n");
     }
+  }
+  int nErr1 = (int)TOLErrorNumber().Value();
+  BSetFromFile* sff = (BSetFromFile*)result;
+  if(sff && (!sff->Contens().Card()) && (nErr1>nErr0))
+  {
+    DESTROY(result);
   }
   return(result);
Index: tol/btol/set_type/tol_bsetgra.h
===================================================================
--- tol/btol/set_type/tol_bsetgra.h	(revision 6eef720714c57e6a45a25c4e08786bbdd0f5d745)
+++ tol/btol/set_type/tol_bsetgra.h	(revision 904521eac0de0fb8b92cd1809fd95983f50b3676)
@@ -215,4 +215,5 @@
   static BList*	      compiled_;
   static BInt	        nSetFromFile_;
+  static BInt	        nSetFromFileGlobal_;
   BText  tolPath_;
 #if defined(_MSC_VER)
@@ -246,4 +247,6 @@
 
   static BInt NSetFromFile() { return(nSetFromFile_); }
+  static BInt NSetFromFileGlobal() { return(nSetFromFileGlobal_); }
+
   const BText& TolPath() const { return(tolPath_); }
   BBool	    Open       ();
Index: tol/lang/language.cpp
===================================================================
--- tol/lang/language.cpp	(revision 6eef720714c57e6a45a25c4e08786bbdd0f5d745)
+++ tol/lang/language.cpp	(revision 904521eac0de0fb8b92cd1809fd95983f50b3676)
@@ -1333,28 +1333,32 @@
 //--------------------------------------------------------------------
 {
-    BText fileName = Text(Arg(1));
-    contens_ = fileName;
-    ofstream out;
-    if(fileName!="Std") { out.open(fileName.String()); }
-    WriteFileOrStd(fileName,out,(I2("Name~   Path~   Elements~",
-            "Nombre~ Camino~ Elementos~")+"\n"));
-    
-    for(BInt n=1; n<=BSetFromFile::NSetFromFile(); n++)
-    {
-  BSetFromFile* file = (BSetFromFile*)BSetFromFile::FindCompiled(n);
-  BSet& set = file->Contens();
-  WriteFileOrStd
+  BText fileName = Text(Arg(1));
+  contens_ = fileName;
+  ofstream out;
+  if(fileName!="Std") { out.open(fileName.String()); }
+  WriteFileOrStd(fileName,out,
+  (I2("Name~   Path~   Elements~",
+      "Nombre~ Camino~ Elementos~")+"\n"));
+  int size = BSetFromFile::NSetFromFileGlobal();
+  for(BInt n=1; n<=size; n++)
+  {
+    BSetFromFile* file = (BSetFromFile*)BSetFromFile::FindCompiled(n);
+    if(file)
+    {
+      BSet& set = file->Contens();
+      WriteFileOrStd
       (
-    fileName,out,
-    (
-        file->Identify() + "~" +
-        file->TolPath()      + "~" +
-        set.Card()   + "~" + "\n"
+        fileName,out,
+        (
+          file->Identify() + "~" +
+          file->TolPath()      + "~" +
+          set.Card()   + "~" + "\n"
         )
-    );
-    }
+      );
+    }
+  }
     
 //    if(fileName!="Std") { BSys::EditTable(fileName, BSTFILE); }
-    if(fileName!="Std") { out.close(); }
+  if(fileName!="Std") { out.close(); }
 }
 
