         // To prevent skipping, we set default value of 1 for every symbol's frequency.
         var stats = Array(repeating: 1, count: maxSymbol + 2)
 
-        for i in 0..<symbolOut.count {
-            let symbol = symbolOut[i]
+        for i in 0..<out.count {
+            let symbol = out[i]
             stats[symbol] += 1
             processed -= 1
-            if processed <= 0 || i == symbolOut.count - 1 {
+            if processed <= 0 || i == out.count - 1 {
                 processed = 50
                 // We need to calculate code lengths for our current stats.
                 let lengths = BZip2.lengths(from: stats)

                    tables.append(table)
                    tablesLengths.append(lengths.sorted { $0.symbol < $1.symbol }.map { $0.codeLength })
                    selectors.append(tables.count - 1)
                    selectorsUsed += 1
                } else {
                    selectors.append(minimumSelector)
                    selectorsUsed += 1
                }

                // Clear stats.

        }

        bitWriter.write(number: tables.count, bitsCount: 3)
        bitWriter.write(number: selectors.count, bitsCount: 15)

        let mtfSelectors = mtf(selectors, characters: Array(0..<selectors.count))
        for selector in mtfSelectors {
            guard selector <= 5
                else { fatalError("Incorrect selector.") }
