diff --git a/src/@dseries/initialize.m b/src/@dseries/initialize.m
index b7778d10f6bc25aad31709465529136dc8be4ada..4a42ad28e81ed0d640ea7d57221080018c12ad49 100644
--- a/src/@dseries/initialize.m
+++ b/src/@dseries/initialize.m
@@ -16,7 +16,7 @@ function initialize(fake)
 % along with Dynare.  If not, see <http://www.gnu.org/licenses/>.
 
 % Get the path to the dseries toolbox.
-dseries_src_root = strrep(which('@dseries/initialize'),'@dseries/initialize.m','');
+dseries_src_root = strrep(which('@dseries/initialize.m'),'@dseries/initialize.m','');
 
 % Check that the x13 binary is available
 nox13 = false;