Minor changes, mostly related to debug logging.