Cleaning and output stats when done.