diff --git a/matlab/accessors/get_param_by_name.m b/matlab/accessors/get_param_by_name.m
index 8b9b06c3957ce703bd1b6374ad56e0194cfb3542..60aa609848202543236969b3554a213938611d32 100644
--- a/matlab/accessors/get_param_by_name.m
+++ b/matlab/accessors/get_param_by_name.m
@@ -33,7 +33,7 @@ global M_
 i = strmatch(pname,M_.param_names,'exact');
 
 if isempty(i)
-    error(sprintf('Can''t find parameter %s', pname))
+    error('Can''t find parameter %s', pname)
 end
 
 x = M_.params(i);
diff --git a/matlab/estimation/draw_prior_density.m b/matlab/estimation/draw_prior_density.m
index 59a47195716b900ad0e34fae9a173ee701b71b07..348231a225a468966aca05aacb7b47f749d7b1a0 100644
--- a/matlab/estimation/draw_prior_density.m
+++ b/matlab/estimation/draw_prior_density.m
@@ -80,7 +80,7 @@ switch pshape(indx)
     abscissa = linspace(infbound,supbound,steps);
     dens = density(abscissa,p6(indx),p7(indx),p3(indx));
   otherwise
-    error(sprintf('draw_prior_density: unknown distribution shape (index %d, type %d)', indx, pshape(indx)));
+    error('draw_prior_density: unknown distribution shape (index %d, type %d)', indx, pshape(indx));
 end
 
 if pshape(indx) ~= 5
@@ -88,9 +88,9 @@ if pshape(indx) ~= 5
     if k1 == 1 || k1 == length(dens)
         k = find(dens > 10);
         dens(k) = NaN;
+        end
     end
-end
 binf = abscissa(1);
 bsup = abscissa(end);
 x = abscissa;
-f = dens;
\ No newline at end of file
+f = dens;
diff --git a/matlab/lmmcp/get_complementarity_conditions.m b/matlab/lmmcp/get_complementarity_conditions.m
index 6bf8bf548187376b33e5c5609eb1c7987d641cc5..5d3f961f59f304ebdaf915f6b41d1505a0ba4356 100644
--- a/matlab/lmmcp/get_complementarity_conditions.m
+++ b/matlab/lmmcp/get_complementarity_conditions.m
@@ -57,8 +57,7 @@ for i=1:size(etags,1)
         if ~isempty(kop)
             k = find(strcmp(strtrim(str(1:kop-1)), M_.endo_names)); %get variable index with restriction
             if isempty(k)
-                error(sprintf(['Complementarity condition %s: variable %s is ' ...
-                               'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
+                error('Complementarity condition %s: variable %s is not recognized', etags{i,3}, strtrim(str(1:kop-1)))
             end
             ub(k) = str2num(str(kop+1:end));
             eq_index(eq_nbr) = k;
@@ -68,15 +67,13 @@ for i=1:size(etags,1)
             if ~isempty(kop)
                 k = find(strcmp(strtrim(str(1:kop-1)), M_.endo_names)); %get variable index with restriction
                 if isempty(k)
-                    error(sprintf(['Complementarity condition %s: variable %s is ' ...
-                                   'not recognized'],etags{i,3},strtrim(str(1:kop-1))))
+                    error('Complementarity condition %s: variable %s is not recognized', etags{i,3}, strtrim(str(1:kop-1)))
                 end
                 lb(k) = str2num(str(kop+1:end));
                 eq_index(eq_nbr) = k;
                 eq_index(k) = eq_nbr;
             else
-                error(sprintf(['Complementarity condition %s can''t be ' ...
-                               'parsed'],etags{i,3}))
+                error('Complementarity condition %s can''t be parsed',etags{i,3})
             end
         end
     end
diff --git a/matlab/modules/dseries b/matlab/modules/dseries
index 1bb3b1cbc9d1b29136e8e533d871e247f1b11103..8acb7f8d5f6418717a9ad47e6b6b911354a86409 160000
--- a/matlab/modules/dseries
+++ b/matlab/modules/dseries
@@ -1 +1 @@
-Subproject commit 1bb3b1cbc9d1b29136e8e533d871e247f1b11103
+Subproject commit 8acb7f8d5f6418717a9ad47e6b6b911354a86409
diff --git a/matlab/set_historical_values.m b/matlab/set_historical_values.m
index 9b09eec661d95a53f8c671547d03b9ea0be27762..ddb9da79a643469a934134bbf006f96c6dd85657 100644
--- a/matlab/set_historical_values.m
+++ b/matlab/set_historical_values.m
@@ -48,7 +48,7 @@ for i = 1:M_.endo_nbr
                 M_.endo_histval(i, M_.maximum_endo_lag) = ...
                     ds{M_.endo_names{i}}(initialperiod).data;
             else
-                error(sprintf('Can''t find %s in dseries', M_.endo_names{i}))
+                error('Can''t find %s in dseries', M_.endo_names{i})
             end
         end
     else
@@ -58,7 +58,7 @@ for i = 1:M_.endo_nbr
                 M_.endo_histval(i,M_.maximum_endo_lag) = ...
                     ds{M_.endo_names{a.orig_index}}(initialperiod+a.orig_lead_lag).data;
             else
-                error(sprintf('Can''t find %s in dseries', M_.endo_names{a.orig_index}))
+                error('Can''t find %s in dseries', M_.endo_names{a.orig_index})
             end
         end
         k = k + 1;
@@ -83,4 +83,4 @@ if M_.maximum_exo_lag
             end
         end
     end
-end
\ No newline at end of file
+end
diff --git a/matlab/utilities/dataset/makedataset.m b/matlab/utilities/dataset/makedataset.m
index 4532d0ccc35988f6eb6ad404708920233137d346..f48e5837f4b1a5cd3ffed339df1374fd9c4050b5 100644
--- a/matlab/utilities/dataset/makedataset.m
+++ b/matlab/utilities/dataset/makedataset.m
@@ -69,10 +69,10 @@ elseif isempty(options_.datafile) && ~isempty(options_.dataset.series)
     try
         dseriesobjectforuserdataset = evalin('base', options_.dataset.series);
     catch
-        error(sprintf('makedataset: %s is unknown!', options_.dataset.series))
+        error('makedataset: %s is unknown!', options_.dataset.series)
     end
     if ~isdseries(dseriesobjectforuserdataset)
-        error(sprintf('makedataset: %s has to be a dseries object!', options_.dataset.series))
+        error('makedataset: %s has to be a dseries object!', options_.dataset.series)
     end
     datafile = [];
     newdatainterface = 1;
@@ -103,7 +103,7 @@ if ~isempty(datafile)
             end
         end
         if isempty(available_extensions)
-            error(['makedataset: I can''t find a datafile (with allowed extension m, mat, csv, xls or xlsx)!'])
+            error('makedataset: I can''t find a datafile (with allowed extension m, mat, csv, xls or xlsx)!')
         end
         if length(available_extensions)>1
             error(sprintf(['makedataset: You did not specify an extension for the datafile, but more than one candidate ' ...
@@ -203,7 +203,7 @@ if newdatainterface
         else
             % last_obs and nobs were used in the data command. Check that they are consistent (with firstobs).
             if ~isequal(lastobs,firstobs+(nobs-1))
-                error(sprintf('makedataset: Options last_obs (%s), first_obs (%s) and nobs (%s) are not consistent!',char(lastobs),char(firstobs),num2str(nobs)));
+                error('makedataset: Options last_obs (%s), first_obs (%s) and nobs (%s) are not consistent!',char(lastobs),char(firstobs),num2str(nobs));
             end
         end
     end
@@ -227,23 +227,23 @@ FIRSTOBS = firstobs-initialconditions;
 
 % Check that firstobs belongs to dataset_.dates
 if firstobs<dataset_.init
-    error(sprintf('makedataset: first_obs (%s) cannot be less than the first date in the dataset (%s)!',char(firstobs),char(dataset_.init)))
+    error('makedataset: first_obs (%s) cannot be less than the first date in the dataset (%s)!',char(firstobs),char(dataset_.init))
 end
 
 % Check that FIRSTOBS belongs to dataset_.dates
 if initialconditions && FIRSTOBS<dataset_.init
-    error(sprintf('makedataset: first_obs (%s) - %i cannot be less than the first date in the dataset (%s)!\nReduce the number of lags in the VAR model or increase the value of first_obs\nto at least first_obs=%i.', char(firstobs), initialconditions, char(dataset_.init),initialconditions+1));
+    error('makedataset: first_obs (%s) - %i cannot be less than the first date in the dataset (%s)!\nReduce the number of lags in the VAR model or increase the value of first_obs\nto at least first_obs=%i.', char(firstobs), initialconditions, char(dataset_.init),initialconditions+1);
 end
 
 % Check that lastobs belongs to dataset_.dates...
 if newdatainterface
     if lastobs>dataset_.dates(end)
-        error(sprintf('makedataset: last_obs (%s) cannot be greater than the last date in the dataset (%s)!',char(lastobs),char(dataset_.dates(end))))
+        error('makedataset: last_obs (%s) cannot be greater than the last date in the dataset (%s)!',char(lastobs),char(dataset_.dates(end)))
     end
 else
     % ...  or check that nobs is smaller than the number of observations in dataset_.
     if nobs>dataset_.nobs
-        error(sprintf('makedataset: nobs (%s) cannot be greater than the last date in the dataset (%s)!', num2str(nobs), num2str(dataset_.nobs)))
+        error('makedataset: nobs (%s) cannot be greater than the last date in the dataset (%s)!', num2str(nobs), num2str(dataset_.nobs))
     end
 end