Fix length return value problem in send_parts