Enhancements to debugging output; tidy