Fix download bugs.