             else { throw XZError.fieldReservedValue }
 
         /// Should match size of compressed data.
-        var compressedSize = -1
-        if blockFlags & 0x40 != 0 {
-            let compressedSizeDecodeResult = try pointerData.multiByteDecode()
-            compressedSize = compressedSizeDecodeResult.multiByteInteger
-            guard compressedSize > 0
-                else { throw XZError.wrongFieldValue }
-            blockBytes.append(contentsOf: compressedSizeDecodeResult.bytesProcessed)
-        }
+        let compressedSize = blockFlags & 0x40 != 0 ? try pointerData.multiByteDecode() : -1
 
         /// Should match the size of data after decompression.
-        var uncompressedSize = -1
-        if blockFlags & 0x80 != 0 {
-            let uncompressedSizeDecodeResult = try pointerData.multiByteDecode()
-            uncompressedSize = uncompressedSizeDecodeResult.multiByteInteger
-            guard uncompressedSize > 0
-                else { throw XZError.wrongFieldValue }
-            blockBytes.append(contentsOf: uncompressedSizeDecodeResult.bytesProcessed)
-        }
+        let uncompressedSize = blockFlags & 0x80 != 0 ? try pointerData.multiByteDecode() : -1
 
         // TODO: First parse, then use.
         var filters: [(DataWithPointer) throws -> [UInt8]] = []
         for _ in 0..<numberOfFilters {
-            let filterIDTuple = try pointerData.multiByteDecode()
-            let filterID = filterIDTuple.multiByteInteger
-            blockBytes.append(contentsOf: filterIDTuple.bytesProcessed)
+            let filterID = try pointerData.multiByteDecode()
             guard UInt64(filterID) < 0x4000000000000000
                 else { throw XZError.wrongFilterID }
             // Only LZMA2 filter is supported.
             switch filterID {
             case 0x21: // LZMA2
                 // First, we need to skip byte with the size of filter's properties
-                blockBytes.append(contentsOf: try pointerData.multiByteDecode().bytesProcessed)
+                _ = try pointerData.multiByteDecode()
                 /// In case of LZMA2 filters property is a dicitonary size.
                 let filterPropeties = pointerData.byte()
-                blockBytes.append(filterPropeties)
                 let closure = { (dwp: DataWithPointer) -> [UInt8] in
                     try LZMA2.decompress(LZMA2.dictionarySize(filterPropeties), dwp)
                 }

        }

        // We need to take into account 4 bytes for CRC32 so thats why "-4".
        while pointerData.index - blockHeaderStartIndex < realBlockHeaderSize.toInt() - 4 {
            let byte = pointerData.byte()
            guard byte == 0x00
                else { throw XZError.wrongPadding }
            blockBytes.append(byte)
        }

        let blockHeaderCRC = pointerData.uint32()
        guard CheckSums.crc32(blockBytes) == blockHeaderCRC
            else { throw XZError.wrongInfoCRC }

        var intResult = pointerData
        let compressedDataStart = pointerData.index

        return (checkType, flagsCRC)
    }

    private static func processBlock(_ blockHeaderSize: Int,
                                     _ pointerData: DataWithPointer) throws -> (blockData: [UInt8], unpaddedSize: Int, uncompressedSize: Int) {
        let blockHeaderStartIndex = pointerData.index - 1
        guard blockHeaderSize >= 0x01 && blockHeaderSize <= 0xFF
            else { throw XZError.wrongFieldValue }
        let realBlockHeaderSize = (blockHeaderSize + 1) * 4

        let blockFlags = pointerData.byte()
        /**
         Bit values 00, 01, 10, 11 indicate filters number from 1 to 4,
         so we actually need to add 1 to get filters' number.
