diff --git a/compiler/comphook.pas b/compiler/comphook.pas
index 0bb9756811..9d02bc4c73 100644
--- a/compiler/comphook.pas
+++ b/compiler/comphook.pas
@@ -148,9 +148,7 @@ const
 implementation
 
   uses
-{$IFDEF USE_SYSUTILS}
-    SysUtils,
-{$ELSE USE_SYSUTILS}
+{$IFNDEF USE_SYSUTILS}
    dos,
 {$ENDIF USE_SYSUTILS}
    cutils
diff --git a/compiler/compiler.pas b/compiler/compiler.pas
index 32f093d29c..543540fcc6 100644
--- a/compiler/compiler.pas
+++ b/compiler/compiler.pas
@@ -235,9 +235,6 @@ function Compile(const cmd:string):longint;
 implementation
 
 uses
-{$IFDEF USE_SYSUTILS}
-  SysUtils,
-{$ENDIF USE_SYSUTILS}
   aasmcpu;
 
 {$ifdef EXTDEBUG}
diff --git a/compiler/globals.pas b/compiler/globals.pas
index f0e4342db5..132701e1ab 100644
--- a/compiler/globals.pas
+++ b/compiler/globals.pas
@@ -684,7 +684,11 @@ implementation
             PathExists := true;
             exit;
           end;
+{$ifdef USE_SYSUTILS}
+        F := ExpandFileName(F);
+{$else USE_SYSUTILS}
         F := FExpand (F);
+{$endif USE_SYSUTILS}
         I := Pos (DriveSeparator, F);
         if (F [Length (F)] = DirectorySeparator)
                   and (((I = 0) and (Length (F) > 1)) or (I <> Length (F) - 1))
@@ -1150,7 +1154,11 @@ implementation
            currPath:= CurDirRelPath(source_info)
          else
           begin
+{$ifdef USE_SYSUTILS}
+            currPath:=FixPath(ExpandFileName(currpath),false);
+{$else USE_SYSUTILS}
             currPath:=FixPath(FExpand(currPath),false);
+{$endif USE_SYSUTILS}
             if (CurrentDir<>'') and (Copy(currPath,1,length(CurrentDir))=CurrentDir) then
              begin
 {$ifdef AMIGA}
@@ -1185,7 +1193,7 @@ implementation
                         end;
                     end;
                 until findnext(dir) <> 0;
-              end
+              end;
 {$ELSE USE_SYSUTILS}
             findfirst(prefix+'*',directory,dir);
             while doserror=0 do
diff --git a/compiler/options.pas b/compiler/options.pas
index 52b8acc447..ab82d928aa 100644
--- a/compiler/options.pas
+++ b/compiler/options.pas
@@ -1304,7 +1304,11 @@ begin
    Message(option_too_many_cfg_files);
 { open file }
   Message1(option_using_file,filename);
+{$ifdef USE_SYSUTILS}
+  assign(f,ExpandFileName(filename));
+{$else USE_SYSUTILS}
   assign(f,FExpand(filename));
+{$endif USE_SYsUTILS}
   {$I-}
   reset(f);
   {$I+}