 list of strings, giving the binary name and arguments.")
 
 (defun tern-start-server (c)
-  (let* ((default-directory tern-project-dir)
+  (let* ((default-directory (tern-project-dir))
          (cmd (if (member "--strip-crs" tern-command) tern-command (append tern-command '("--strip-crs"))))
          (proc (apply #'start-process "Tern" nil cmd))
          (all-output ""))

         (cond ((not err)
                (dolist (file files)
                  (when (equal (cdr (assq 'type file)) "full")
                    (with-current-buffer (find-file-noselect (expand-file-name (cdr (assq 'name file)) tern-project-dir))
                      (setf tern-buffer-is-dirty nil))))
                (funcall f data))
               ((not (eq mode :silent)) (tern-message "Request failed: %s" err)))))

      (when (and (not (eq buf (current-buffer)))
                 (buffer-local-value 'tern-mode buf)
                 (buffer-local-value 'tern-buffer-is-dirty buf)
                 (equal (tern-project-dir) (with-current-buffer buf (tern-project-dir))))
        (with-current-buffer buf
          (push `((type . "full")
                  (name . ,(tern-project-relative-file))
