diff --git a/Common/CreateFile.cpp b/Common/CreateFile.cpp
index 57de2f75092b8b989e5dff8a52838884b8b13f24..3f69d2e2d7db6c45c6df70700946da37993c712e 100644
--- a/Common/CreateFile.cpp
+++ b/Common/CreateFile.cpp
@@ -397,6 +397,7 @@ void CreateOutputFile(std::string fileName, int format)
 
   case FORMAT_TEX:
     {
+      printf("couc tex format \n");
       if(!FlGui::available()) break;
 
       FILE *fp = fopen(fileName.c_str(), "w");
@@ -428,7 +429,7 @@ void CreateOutputFile(std::string fileName, int format)
 #endif
 
   default:
-    Msg::Error("Unknown output file format");
+    Msg::Error("Unknown output file format %d", format);
     printEndMessage = false;
     break;
   }
diff --git a/Solver/function.cpp b/Solver/function.cpp
index a493fa0a91dec20d2c866229dc605e7c207915c5..6143b8d781fc26cdc13692e7fb6da82eca4830aa 100644
--- a/Solver/function.cpp
+++ b/Solver/function.cpp
@@ -373,7 +373,7 @@ class functionC : public function {
     FILE *tmpMake = fopen("_tmpMake","w");
     fprintf(tmpMake, "include $(DG_BUILD_DIR)/CMakeFiles/dg.dir/flags.make\n"
         "%s : %s\n"
-        "\tg++ -shared -fPIC -o $@ $(CXX_FLAGS) $(CXX_DEFINES) $<\n",
+        "\tg++ -fPIC -shared -o $@ $(CXX_FLAGS) $(CXX_DEFINES) $<\n",
         filename.c_str(), "_tmpSrc.cpp");
     fclose(tmpMake);
     if(system("make -f _tmpMake"))
@@ -548,3 +548,9 @@ functionConstant *function::getTime() {
     _timeFunction = functionConstantNew(0.);
   return _timeFunction;
 }
+functionConstant *function::_dtFunction = NULL;
+functionConstant *function::getDT() {
+  if (! _dtFunction)
+    _dtFunction = functionConstantNew(0.);
+  return _dtFunction;
+}
diff --git a/Solver/function.h b/Solver/function.h
index d1ca9706c33bb4ea7c717d226d08cfb176dff5bc..737c4f9071da3480bb3d5b275ff4f4111938beb1 100644
--- a/Solver/function.h
+++ b/Solver/function.h
@@ -21,7 +21,8 @@ class functionReplaceCache;
 // An abstract interface to functions 
 // more explanation at the head of this file
 class function {
-  static functionConstant *_timeFunction; 
+  static functionConstant *_timeFunction;
+  static functionConstant *_dtFunction;  
   public :
   class argument {
     //iMap is the id of the dataCacheMap, e.g. on interfaces
@@ -75,6 +76,7 @@ class function {
   static function *getParametricCoordinates();
   static function *getNormals();
   static functionConstant *getTime();
+  static functionConstant *getDT();
 };
 
 // dataCache when the value is a  matrix of double