Small changes to upload.py