 	(return nil)))
     (sw:exit-lisp)
     (sit-for 3))
-  (if (null base-world-name)
-      (run-plain-lisp 1)
-    (let ((sw:common-lisp-image-file base-world-name))
-      (sit-for 3)
-      (run-lisp-application)))
+  (cond ((null base-world-name)
+	 (run-plain-lisp 1))
+	(t
+	 (sit-for 3)
+	 (run-lisp-application 
+	  (sw::normalize-filename (expand-file-name (getenv "LISP_EXECUTABLE")))
+	  (sw::normalize-filename (expand-file-name base-world-name)))))
   (sit-for 3)
   (eval-in-lisp-in-order
    (format "(cl:load %S)"

					    slash-dir)))
  (eval-in-lisp-in-order (format "(specware::setenv \"SPECWARE4\" %S)"
				    (sw::normalize-filename *specware4-dir)))
  (eval-in-lisp-in-order
   (format "(cl:load %S)"
	   (concat *specware4-dir "/Applications/Handwritten/Lisp/exit-on-errors")))
  (eval-in-lisp-in-order
   (format "(cl:load %S)"
	   (concat *specware4-dir "/Applications/Handwritten/Lisp/memory-management")))
  (eval-in-lisp-in-order
   (format "(cl:namestring (specware::change-directory %S))" build-dir))
  (eval-in-lisp-in-order "(cl-user::set-gc-parameters-for-build nil)")
  (eval-in-lisp-in-order "(cl:load \"Specware4.lisp\")")
  (eval-in-lisp-in-order "(cl-user::compact-memory t)")
  (eval-in-lisp-in-order "(cl-user::set-gc-parameters-for-use nil)")
  (when (file-exists-p world-name)
    (rename-file world-name (concat bin-dir "/Specware4-saved."
				    *lisp-image-extension*)
		 t))
  (sit-for 5)
  (eval-in-lisp-in-order (format (case *specware-lisp*

    (sw:exit-lisp)
    (sit-for 2))
  (setq sw:common-lisp-host "localhost")

  ;; sw:common-lisp-directory is the directory in which the lisp subprocess will
  ;; be executed. It is defined in eli/fi-subproc.el with a default value nil
  ;; This seems to work fine under Unix/Linux but under Windows there is 
  ;; a "stringp, nil" error message. So we set it to "c:." to avoid the problem.

  (setq sw:common-lisp-directory (getenv "LISP_DIRECTORY"))

  ;; Below we set a parameter sw:common-lisp-image-name. This is the name 
  ;; used by eli/fi-subproc.el for the Lisp executable. This is the application
  ;; we want to run.  The image file (in the ACL sense) or world, is bound 
  ;; to common-lisp-image-file. If the executable is produced by
  ;; generate-application, then typically, there will not be an ACL image file.

  (setq sw:common-lisp-image-name (getenv "LISP_EXECUTABLE"))
  (setq sw:common-lisp-image-file nil)
  (setq sw:common-lisp-image-arguments
	(if *windows-system-p* '("+cm") nil)) ; see note above

  (let ((log-warning-minimum-level 'error))
    (sw:common-lisp sw:common-lisp-buffer-name
