debugger: Multiple fixes from further tests.
Closes issue #2 and issue #3.