Fix multipart encoding #771