Clean up download code.