Add progress tracking, fix some bugs