Fix bug in Upload class