Fixed a bug with upload/download