   [^long min-base-quality]
   (fn [p]
     (->> #(<= min-base-quality (.qual ^PileupBase %))
-         (partial filterv)
+         (partial filter)
          (update p 1))))
 
 (defn- unzip-2

  "Find a piled-up base and an indel from an alignment."
  [^long ref-pos ^SAMAlignment aln]
  (let [relative-pos (- ref-pos (.pos aln))
        qual ((:quals-at-ref aln) relative-pos)
        [base indel] ((:seqs-at-ref aln) relative-pos)
        deletion? (number? indel)]
    (plpio/->PileupBase
     (zero? relative-pos)

(defn- merge-corrected-quals
  "Merge corrected quals with the uncorrected part."
  [^SAMAlignment aln ^long correct-start corrected-quals]
  (let [^shorts quals (:quals-at-ref aln)
        start (.pos aln)
        len   (count corrected-quals)
        quals' (java.util.Arrays/copyOf quals (alength quals))
        start' (if (< start correct-start) (- correct-start start) 0)]
    (dotimes [i len]
      (aset quals' (+ start' i) (short (corrected-quals i))))
    quals'))

(defn- correct-pair-qual
  [^SAMAlignment a1 ^SAMAlignment a2]
  (let [pos1 (.pos a1)
        pos2 (.pos a2)
        ^shorts quals1 (:quals-at-ref a1)
        ^shorts quals2 (:quals-at-ref a2)
        ^objects seqs1 (:seqs-at-ref a1)
        ^objects seqs2 (:seqs-at-ref a2)]
    (fn [^long pos]
      (let [relative-pos1 (- pos pos1)
            relative-pos2 (- pos pos2)
            q1 (aget quals1 relative-pos1)
            q2 (aget quals2 relative-pos2)
            b1 (-> seqs1 ^PosBase (aget relative-pos1) .-base)
            b2 (-> seqs2 ^PosBase (aget relative-pos2) .-base)]
        (if (= b1 b2)
          [(min 200 (+ q1 q2)) 0]
          (if (<= q2 q1)
