               (if leaf?
                 (letfn [(read-leaves [n]
                           (when-not (zero? n)
-                            (let [key (lsb/read-string r key-size)
+                            (let [key (read-c-style-string r key-size)
                                   id (lsb/read-uint r)
                                   _size (lsb/read-uint r)]
                               (if (zero? (compare chrom key))

                    root-offset])

; Currently, max number of zoom levels (i.e. max number of zoom headers) is 10,
; the number is small. Therefore, we choose a record containing vector of zoom
; header instead of a flat record.
; Cf. https://github.com/ucscGenomeBrowser/kent/blob/3a0198acd1f859a603f5aad90188bee2d82efe0c/src/inc/bbiFile.h#L384
(defrecord BigWigHeaders [^FixedWidthHeader fixed-width-header

                  (letfn [(through-remainder [n offset]
                            (if (or (zero? n)
                                    (neg? (compare chrom
                                                   (read-c-style-string r key-size))))
                              offset
                              (recur (dec n) (lsb/read-ushort r))))]
                    (recur (through-remainder (dec child-count)
