Fix uploading bugs.