The result of the bitwise AND was an integer, which when shifted left by more than 31, results in zero. This led to incorrect decoding of varlongs larger than 5 bytes.