Get run_debug working better, and other cleanup.