Fix malformed packets