Fixed print to stdout for each thread.