Instrument content length from read_ber
Fix logic error in tests