diff --git a/mex/sources/k_order_perturbation/dynamic_dll.cpp b/mex/sources/k_order_perturbation/dynamic_dll.cpp
index d695db89658bf0b2d47be250c950e65da8fbfc1f..70ec66d9c3e265fdac4ae4ab04a5a549228a15a4 100644
--- a/mex/sources/k_order_perturbation/dynamic_dll.cpp
+++ b/mex/sources/k_order_perturbation/dynamic_dll.cpp
@@ -64,7 +64,12 @@ DynamicModelDLL::DynamicModelDLL(const string &modName, const int y_length, cons
   catch (int i)
     {
       ostringstream msg;
-      msg << "Can't load " << fName << " (error code: " << i;
+      msg << "Error when loading " << fName << " (";
+      if (i == 1)
+        msg << "can't dynamically load the file";
+      if (i == 2)
+        msg << "can't locate the 'Dynamic' symbol";
+      msg << ")";
       throw DynareException(__FILE__, __LINE__, msg.str());
     }
   catch (...)