Fix the second-to-last packet getting shortened