          (prefix (if (string-equal s "") s (concat s "."))))
     (cons prefix suffix)))
 
-(defun merlin--completion-prepare-labels (labels suffix)
-  ; Remove non-matching entry, adjusting optional labels if needed
-  (setq labels (delete-if-not (lambda (x)
-                                (let ((name (cdr (assoc 'name x))))
-                                  (or (string-prefix-p suffix name)
-                                      (when (equal (aref name 0) ??)
-                                        (aset name 0 ?~)
-                                        (string-prefix-p suffix name)))))
-                              labels))
-  (mapcar (lambda (x) (append x '((kind . "Label") (info . nil)))) labels))
+(defun merlin--completion-prepare-labels (labels prefix)
+  ;; Remove non-matching entry, adjusting optional labels if needed
+  (cl-loop for x in labels
+           for name = (cdr (assoc 'name x))
+           when (or (string-prefix-p prefix name)
+                    (when (equal (aref name 0) ??)
+                      (aset name 0 ?~)
+                      (string-prefix-p prefix name)))
+           collect (append x '((kind . "Label") (info . nil)))))
 
 (defun merlin/complete (ident)
   "Return the data for completion of IDENT, i.e. a list of tuples of the form

        (filename    (buffer-file-name (buffer-base-buffer))))
    ;; Update environment
    (dolist (binding (merlin-lookup 'env merlin-buffer-configuration))
      (let* ((equal-pos (string-match "=" binding))
             (prefix (if equal-pos
                       (substring binding 0 (1+ equal-pos))
                       binding))

    (setq errors (remove-if-not (lambda (e) (assoc 'start e)) errors))
    (unless merlin-report-warnings
      (setq errors (remove-if (lambda (e)
                                (or
                                  (eq (cdr-safe (assoc 'message e)) "warning")
                                  (merlin--error-warning-p (cdr (assoc 'message e)))))
                              errors)))
    (setq merlin-erroneous-buffer (or errors no-loc))
    (dolist (e no-loc)
