Correct some bugs with downloading and make code consistent.