Merge change I9c147b84

* changes:
  Fix various bugs found when debugger is attached to the VM.