Avoid errors when parsing malformed packets