diff --git a/code/classes/SCD.m b/code/classes/SCD.m
index aab9167e506fcc5d3674a2bdc036b21516e7011f..6f919860aef4f3eb43f55c59edc150a211d9c699 100644
--- a/code/classes/SCD.m
+++ b/code/classes/SCD.m
@@ -48,12 +48,15 @@ classdef SCD
  
   function clean_dd()
     % Close all data open dictionaries
-    fprintf('Closing all data dictionaries and discarding changes')
+    fprintf('Closing all data dictionaries and discarding changes\n')
     Simulink.data.dictionary.closeAll('-discard');
     % Cleans unversioned data dictionaries
     fprintf('Cleaning unversioned data dictionaries for clean test\n')
+    [~,s] = system('git rev-parse --show-toplevel');  % get top-level dir
+    oldpwd = pwd; cd(deblank(s));
     system('git clean -xf *.sldd');  % clean local sldd
     system('git submodule foreach --quiet ''git clean -fx *.sldd'''); % clean submodules too
+    cd(oldpwd)
   end
   
   function SCDexps = getexpcodecontainer()