It seems that the cursor gets at the end of the line of the just modified progress bar, that could gamble the terminal if something is printed (an exception, for example). Restore the position of the cursor at the end of the lines so output can be cleanly shown.