Fix bad input, pad packets