Fix problems with uploading binary data to couchdb.