Fix download.rb exception handling