Various improvements to upload method