             self.choice = Constants.probInitValue
             self.choice2 = Constants.probInitValue
             self.highCoder = BitTreeDecoder(numBits: 8)
-            self.lowCoder = Array(repeating: BitTreeDecoder(numBits: 3), count: 1 << Constants.numPosBitsMax)
-            self.midCoder = Array(repeating: BitTreeDecoder(numBits: 3), count: 1 << Constants.numPosBitsMax)
+            self.lowCoder = []
+            self.midCoder = []
+            for _ in 0..<(1 << Constants.numPosBitsMax) {
+                self.lowCoder.append(BitTreeDecoder(numBits: 3))
+                self.midCoder.append(BitTreeDecoder(numBits: 3))
+            }
         }
 
         func decode(with rangeDecoder: inout RangeDecoder, posState: Int, pointerData: inout DataWithPointer) -> Int {

                self.normalize(pointerData: &pointerData)

                res <<= 1
                res += t + 1
                count -= 1
            } while count > 0
            return res
        }

        func decode(bitWithProb prob: inout Int, pointerData: inout DataWithPointer) -> Int {
            let bound = (self.range >> Constants.numBitModelTotalBits) * prob
            let symbol: Int
            if self.code < bound {
                prob += ((1 << Constants.numBitModelTotalBits) - prob) >> Constants.numMoveBits


            let byte = pointerData.alignedByte()
            for _ in 0..<4 {
                self.code = (self.code << 8) | UInt32(pointerData.alignedByte())
            }
            if byte != 0 || self.code == self.range {
                self.isCorrupted = true
