Made changes to DebugTraceWriter for portable

#2321