Improve exception handling of download handler. Closes #4