Fixed bug where FileDownloaded.total_bytes is not adjusted when resuming and added asserts.
Removed trailing spaces.