Bug fix---use cached length of packet.

But it still didn't significantly change the results.