Small rewrite to fix failing downloads