fix tag length calculation for packed fields