Some Refactoring
Fixed freeze on exit issue in Windows

Problem was in DebugClient.cs