Index: init.c
===================================================================
--- init.c	(revision 982)
+++ init.c	(revision 983)
@@ -353,6 +353,7 @@
         raydium_log("ERROR loading configuration file.");
         if (filename!=NULL)
             {
+            raydium_file_cache_flush();
             fp=raydium_file_fopen(filename,"w");
             if (fp)
                 {
@@ -390,8 +391,8 @@
 //Sky type: \"box\" or \"none\" (currently)\n\
 sky=\"box\";\n\
 ");
+                fclose(fp);
                 }
-            fclose(fp);
             }
         fp=raydium_file_fopen(filename,"rtl"); // Trying to open new created conf file
         }