Correct the tests for dist urls for github
Rethrow download exceptions when no options left & clean up code