Fix bug with failed download handling