Finish downloading part and fix some bugs.