Small tweaks to upload() method