Fix a infinity loop
Add a missing lock
Clean
Prevent buffer percent > 1
Improve GetDownloadInfo