Various multipart fixes, close #296, #297, #298