Fix upload failing first time, fix #1099
- Was introduced with 4939fa4946ab91a19790c56052401e32dc30ce76