Add some more debugging output, and other minor improvements
Authored by: klaussfreire 2016-07-03
Parent: [r13715]
Child: [r13717]