Fix bug when uploading some files.