diff --git a/README.md b/README.md
index 8667bf027accbad2c48bbaffe6e9677f3cb52381..5fd0ea4e63990fe67af6447f98b9b77227629011 100644
--- a/README.md
+++ b/README.md
@@ -71,7 +71,7 @@ A number of tools and libraries are needed in order to recompile everything. You
 - [Autoconf](http://www.gnu.org/software/autoconf/), version 2.62 or later (only if you get the source through Git) (see [Installing an updated version of Autoconf in your own directory, in GNU/Linux](http://www.dynare.org/DynareWiki/AutoMake))
 - [Automake](http://www.gnu.org/software/automake/), version 1.11.2 or later (only if you get the source through Git) (see [Installing an updated version of AutoMake in your own directory, in GNU/Linux](http://www.dynare.org/DynareWiki/AutoMake))
 - An implementation of BLAS and LAPACK: either [ATLAS](http://math-atlas.sourceforge.net/), [OpenBLAS](http://xianyi.github.com/OpenBLAS/), Netlib ([BLAS](http://www.netlib.org/blas/), [LAPACK](http://www.netlib.org/lapack/)) or [MKL](http://software.intel.com/en-us/intel-mkl/) (only if you want to build Dynare++)
-- [MAT File I/O library](http://sourceforge.net/projects/matio/) (if you want to compile Markov-Switching code, the estimation DLL, k-order DLL and Dynare++)
+- [MAT File I/O library](http://sourceforge.net/projects/matio/), version 1.5 or later (if you want to compile Markov-Switching code, the estimation DLL, k-order DLL and Dynare++)
 - [SLICOT](http://www.slicot.org) (if you want to compile the Kalman steady state DLL)
 - [GSL library](http://www.gnu.org/software/gsl/) (if you want to compile Markov-Switching code)
 - A decent LaTeX distribution (if you want to compile PDF documentation),
diff --git a/contrib/ms-sbvar/switch_dw b/contrib/ms-sbvar/switch_dw
index ce173d3fa2605957f7208bf624655893a7dc1768..f1d0fd61ea6d9c4f8694b373780d6c372e344f6e 160000
--- a/contrib/ms-sbvar/switch_dw
+++ b/contrib/ms-sbvar/switch_dw
@@ -1 +1 @@
-Subproject commit ce173d3fa2605957f7208bf624655893a7dc1768
+Subproject commit f1d0fd61ea6d9c4f8694b373780d6c372e344f6e
diff --git a/dynare++/kord/dynamic_model.cc b/dynare++/kord/dynamic_model.cc
index df39c778abc93edc6292b37a986d6ea52c074ecb..3297b596ebe1324f74cef03e9ca0a2589c602e8f 100644
--- a/dynare++/kord/dynamic_model.cc
+++ b/dynare++/kord/dynamic_model.cc
@@ -29,19 +29,13 @@ NameList::writeMat(mat_t *fd, const char *vname) const
       else
         m[j*getNum()+i] = ' ';
 
-#if MATIO_MAJOR_VERSION > 1 || (MATIO_MAJOR_VERSION == 1 && MATIO_MINOR_VERSION >= 5)
   size_t dims[2];
-  const matio_compression compression = MAT_COMPRESSION_NONE;
-#else
-  int dims[2];
-  const int compression = COMPRESSION_NONE;
-#endif
   dims[0] = getNum();
   dims[1] = maxlen;
 
   matvar_t *v = Mat_VarCreate(vname, MAT_C_CHAR, MAT_T_UINT8, 2, dims, m, 0);
 
-  Mat_VarWrite(fd, v, compression);
+  Mat_VarWrite(fd, v, MAT_COMPRESSION_NONE);
 
   Mat_VarFree(v);
   delete[] m;
diff --git a/dynare++/tl/cc/twod_matrix.cc b/dynare++/tl/cc/twod_matrix.cc
index c71393f4415f7411b7848a4197ca681bee710b56..5a4ccfb641d3b96d82c6067a8019d2676b510cf3 100644
--- a/dynare++/tl/cc/twod_matrix.cc
+++ b/dynare++/tl/cc/twod_matrix.cc
@@ -31,13 +31,7 @@ ConstTwoDMatrix::ConstTwoDMatrix(int first_row, int num, const ConstTwoDMatrix &
 void
 ConstTwoDMatrix::writeMat(mat_t *fd, const char *vname) const
 {
-#if MATIO_MAJOR_VERSION > 1 || (MATIO_MAJOR_VERSION == 1 && MATIO_MINOR_VERSION >= 5)
   size_t dims[2];
-  const matio_compression compression = MAT_COMPRESSION_NONE;
-#else
-  int dims[2];
-  const int compression = COMPRESSION_NONE;
-#endif
   dims[0] = nrows();
   dims[1] = ncols();
   auto *data = new double[nrows()*ncols()];
@@ -48,7 +42,7 @@ ConstTwoDMatrix::writeMat(mat_t *fd, const char *vname) const
 
   matvar_t *v = Mat_VarCreate(vname, MAT_C_DOUBLE, MAT_T_DOUBLE, 2, dims, data, 0);
 
-  Mat_VarWrite(fd, v, compression);
+  Mat_VarWrite(fd, v, MAT_COMPRESSION_NONE);
 
   Mat_VarFree(v);
   delete[] data;