Fix flushing issue and added number of files being processed.