Removed unnecessary comments
Added filter to prevent double thread cancelation
Moved output mode macros to misc.cpp
Moved output mode macros to misc.cpp