                       xml/parse
                       (walk-and-emit p-tags))]
     (into []
-          (comp (map #(hash-map                             ; Remove nils/empty strings from :tags and :sentences.
-                        :paragraph/tags (into #{} (filter identity) (:tags %))
-                        :paragraph/sentences (into [] (remove empty?) (:paragraph/sentences %))))
+          (comp (map (fn [doc]                              ; Remove nils/empty strings from :tags and :sentences.
+                       {:paragraph/tags      (into #{} (filter identity) (:paragraph/tags doc))
+                        :paragraph/sentences (into [] (remove empty?) (:paragraph/sentences doc))}))
                 (remove #(empty? (:paragraph/sentences %)))) ; Remove paragraphs with no sentences.
           document)))
 
 (s/fdef parse-document
-  :args (s/cat :stream #(instance? InputStream %) :corpus string?)
+  :args (s/cat :stream any? #_#(instance? InputStream %) :corpus string?)
   :ret :document/paragraphs)
 
 ;; ## Metadata

                                  (r/reduce (fn             ;; Remove repeated categories.
                                              ([] [])
                                              ([a b] (if (= (peek a) b) a (conj a b)))))
                                  (concat [(name-map corpus-name)])
                                  (into []))]
                (assoc m basename
                         #:metadata{:permission  true
                                    :title       (str title (if-not (= "" (string/trim subtitle)) ": " subtitle))
                                    :author      author
                                    :gender      (let [authors (string/split author-gender #"/")]
                                                   (if (every? #(= (first authors) %) authors)

                 [basename _ title subtitle _ _ publisher year isbn _
                  genre-1 genre-2 genre-3 genre-4 _ _
                  author author-year author-gender corpus-name]]
              (let [title (string/trim title)
                    subtitle (string/trim subtitle)
                    metadata-patch? (if-let [v (get ndc-metadata basename)] v false)
                    [genre-1 genre-2 genre-3 genre-4] (if metadata-patch? metadata-patch? [genre-1 genre-2 genre-3 genre-4])
                    category (->> (condp re-seq corpus-name
                                    #"(L|O|P)B" (->> [genre-1 genre-2]
