diff --git a/macOS/build.sh b/macOS/build.sh
index ff4423b34e2a9eae8346198e621c24523abbdbb2..d097ec5482410f58e6dcd0b4e85d70fb82aa99c8 100755
--- a/macOS/build.sh
+++ b/macOS/build.sh
@@ -1,6 +1,6 @@
 #!/usr/bin/env bash
 
-# Copyright © 2019-2023 Dynare Team
+# Copyright © 2019-2024 Dynare Team
 #
 # This file is part of Dynare.
 #
@@ -150,8 +150,8 @@ cp     "$ROOTDIR"/build-doc/*.pdf                                    "$PKGFILES"
 cp     "$ROOTDIR"/build-doc/preprocessor/doc/*.pdf                   "$PKGFILES"/doc
 cp -r  "$ROOTDIR"/build-doc/dynare-manual.html                       "$PKGFILES"/doc
 
-mkdir -p                                                             "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64
-cp -p  "$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64/x13as/x13as           "$PKGFILES"/matlab/modules/dseries/externals/x13/macOS/64
+mkdir -p                                                             "$PKGFILES"/matlab/dseries/externals/x13/macOS/64
+cp -p  "$ROOTDIR"/macOS/deps/"$PKG_ARCH"/lib64/x13as/x13as           "$PKGFILES"/matlab/dseries/externals/x13/macOS/64
 
 
 cd "$ROOTDIR"/macOS/pkg
diff --git a/windows/build.sh b/windows/build.sh
index 7dd42ddb864f23492d616a11a63deaf78a26e2d2..27d12452f8f04141eaeef1e35c8ba599edc7c46d 100755
--- a/windows/build.sh
+++ b/windows/build.sh
@@ -5,7 +5,7 @@
 # The binaries are cross compiled for Windows (64-bit), Octave and MATLAB
 # (all supported versions).
 
-# Copyright © 2017-2023 Dynare Team
+# Copyright © 2017-2024 Dynare Team
 #
 # This file is part of Dynare.
 #
@@ -127,8 +127,8 @@ mkdir "$ZIPDIR"/preprocessor
 cp -p build-win-matlab/preprocessor/src/dynare-preprocessor.exe "$ZIPDIR"/preprocessor
 cp -pr matlab "$ZIPDIR"
 cp -p build-win-matlab/dynare_version.m "$ZIPDIR"/matlab
-mkdir -p "$ZIPDIR"/matlab/modules/dseries/externals/x13/windows/64
-cp -p windows/deps/lib64/x13as/x13as.exe "$ZIPDIR"/matlab/modules/dseries/externals/x13/windows/64
+mkdir -p "$ZIPDIR"/matlab/dseries/externals/x13/windows/64
+cp -p windows/deps/lib64/x13as/x13as.exe "$ZIPDIR"/matlab/dseries/externals/x13/windows/64
 cp -pr examples "$ZIPDIR"
 mkdir -p "$ZIPDIR"/scripts
 cp -p scripts/dynare.el "$ZIPDIR"/scripts
diff --git a/windows/dynare.nsi b/windows/dynare.nsi
index 4b00b15eea69db360e7e4ee2f1bc3f8c964c6165..87bdcdd92ab703ffba6dcb78aa00c1b05e324018 100644
--- a/windows/dynare.nsi
+++ b/windows/dynare.nsi
@@ -60,7 +60,7 @@ Section "Dynare core (preprocessor and M-files)"
  SetOutPath $INSTDIR\matlab\preprocessor64
  File ..\matlab\preprocessor64\dynare_m.exe
 
- SetOutPath $INSTDIR\matlab\modules\dseries\externals\x13\windows\64
+ SetOutPath $INSTDIR\matlab\dseries\externals\x13\windows\64
  File deps\lib64\x13as\x13as.exe
 
  SetOutPath $INSTDIR\contrib