Updated per peer review to make logging debug and more explicit