Misc. debug logging improvements