Misc fixes to debug subsystem