Another change to support debugging; Some code cleanups