   "Send COMMAND (with arguments ARGS) to merlin and returns the result."
   (setq merlin-result nil)
   (setq merlin-ready nil)
-  (if (merlin-send-command-async
-       command
-       #'(lambda (data)
-           (setq merlin-ready t)
-           (setq merlin-result data)) callback-if-exn)
-      (merlin-wait-for-answer)))
+  (when (merlin-send-command-async command
+                                   (lambda (data)
+                                     (setq merlin-ready t)
+                                     (setq merlin-result data))
+                                   callback-if-exn)
+    (merlin-wait-for-answer)))
 
 ;; SPECIAL CASE OF COMMANDS
 (defun merlin-rewind ()

  nil :lighter (:eval (merlin-lighter))
  :keymap merlin-mode-map
  (if merlin-mode
      (if (merlin-is-ml-buffer)
          (merlin-setup)
        (progn
          (if (buffer-file-name)
              (message "merlin can only operate on ml files")
              nil)
          (merlin-mode -1)))
    (when (merlin-is-ml-buffer)
      (if merlin-lock-zone-highlight-overlay
          (delete-overlay merlin-lock-zone-highlight-overlay))
      (if merlin-lock-zone-margin-overlay
          (delete-overlay merlin-lock-zone-margin-overlay))
      (if merlin-highlight-overlay
          (delete-overlay merlin-highlight-overlay))
      ;;(merlin-error-delete-overlays)
      (merlin-process-remove-user))))

(defun merlin-kill-buffer-hook ()
  "Cleans the buffer being killed."
  (if merlin-mode
      (merlin-process-remove-user)))

(add-hook 'merlin-mode-hook
          (lambda ()
            (add-hook 'kill-buffer-hook 'merlin-kill-buffer-hook nil 'make-it-local)
            (add-hook 'after-save-hook 'merlin-to-end nil 'make-it-local)
            (add-hook 'post-command-hook
            'merlin-show-error-on-current-line-soon
            nil 'make-it-local)))

(defun merlin-kill-all-processes ()
  "Kill all the remaining buffers containing merlin processes."

    (if (string-equal s "") s (concat s "."))))

(defun merlin-completion-data (ident)
  "Return the data for completion of IDENT, i.e. a list of pairs (NAME . TYPE)."
  (let ((prefix (merlin-completion-prefix ident))
        (data (append (merlin-get-completion ident) nil)))
    (mapcar (lambda (entry)
