Fixed up debug system a bit