Fixes to upload functions.