Further improve exception handling. Count failed packets.