Fixes and some changes to upload.py