Fix Debugger Issue

Fix issue #1975, which should be an important one, because it affects the debug operations. No test coverage on this, so we will need smoke test on it. 

Please help review. Thanks.