       (cp/with-shutdown! [tpool (get-thread-pool options)]
         (let [pstore (pstore/elasticsearch-path-store es-url options)
               sort (get-sort-or-dummy-fn (:sort options))
-              empty-paths (->> (tree-walker tenant paths pstore options
-                                            empty-paths-finder tpool)
-                               (sort))]
+              empty-paths (sort (tree-walker tenant paths pstore options
+                                             empty-paths-finder tpool))]
           (process-paths tenant empty-paths pstore options
                          remove-empty-paths-processor tpool))))
     (catch Exception e

(defn- get-times
  "Get a list of times."
  [mstore options tenant rollup period path from to]
  (if (or from to)
    (let [result (mstore/fetch mstore tenant rollup period path from to nil)]
      (if (= result :mstore-error) [] (map #(:time %) result)))
    nil))

(defn- remove-metrics-processor
  "Metrics removal processor."

    (cp/with-shutdown! [tpool (get-thread-pool options)]
      (let [pstore (pstore/elasticsearch-path-store es-url options)
            sort (get-sort-or-dummy-fn (:sort options))
            empty-paths (sort (tree-walker tenant paths pstore options
                                           empty-paths-finder tpool))]
        (newline)
        (dorun (map println empty-paths))))
    (catch Exception e
