          (merlin-is-return 
           (merlin-send-command "type" (list "at" (merlin-unmake-point (point)))))))
     (if ret
-        (let ((start (merlin-make-point (cdr (assoc 'start ret))))
-              (end (merlin-make-point (cdr (assoc 'end ret))))
+        (let ((bounds (merlin-make-bounds ret))
               (type (cdr (assoc 'type ret))))
           (if (and
-               (>= start (point))
-               (<= (point) end))
-              (cons (cons start end) type)
+               (>= (car bounds) (point))
+               (<= (point) (cdr bounds)))
+              (cons bounds type)
             nil)))))
           
 

        (if merlin-pending-errors-overlay
            (delete-overlay (pop merlin-pending-errors-overlay)))
        (merlin-create-overlay 'merlin-error-overlay 
                               (merlin-make-point (cdr (assoc 'start err)))
                               (merlin-make-point (cdr (assoc 'end err)))
                               'next-error
                               "2 sec")
        (setq merlin-idle-point (point))

     'bounds-of-ocaml-atom-at-point)

; overlay management
(defun merlin-create-overlay (var bounds face timer)
  "Creates an overlay in the current buffer starting at `start', ending at `end',
using `face' and storing it in `var'. If `timer' is non-nil, the overlay is to disappear after `timer' seconds
`timer' is a string that can be understood by `run-at-time' (eg. \"1 sec\")"
  (if (symbol-value var) (delete-overlay (symbol-value var)))
  (set var (make-overlay (car bounds) (cdr bounds)))
  (overlay-put (symbol-value var) 'face face)
  (if timer
      (run-at-time timer nil `(lambda ()
