Fix how standard output is refreshed