updated debug handling.
logging clean up, somewhat.