fixed a few multipart form handling bugs (closes #642)