Fix num_shards calculation:
add verbose output
Remove debug output
Add stdout flush in case progress bar library doesn't fully flush stdout
always seek the startpos
Fix callback calculations
Fix calculate length