Fixed output for threads (manual fflush), added tagging standards on debug output