diff --git a/matlab/CheckPath.m b/matlab/CheckPath.m
index 51699d8bab28ebd49ce46c1ae93688be4954e527..734efa71924444e0154e1d63c64a0646181f9060 100644
--- a/matlab/CheckPath.m
+++ b/matlab/CheckPath.m
@@ -32,13 +32,13 @@ global M_
 DirectoryName = [ M_.dname '/' type ];
 
 if ~isdir(M_.dname)
-    % Make sure there isn't a file with the same name
+    % Make sure there isn't a file with the same name, see trac ticket #47
     delete(M_.dname)
     mkdir('.', M_.dname);
 end
 
 if ~isdir(DirectoryName)
-    % Make sure there isn't a file with the same name
-    delete(M_.dname)
+    % Make sure there isn't a file with the same name, see trac ticket #47
+    delete(DirectoryName)
     mkdir('.',DirectoryName);
 end