Changes to DebugAgent and minor bug fixes
Merge