Fix typos
Diagnostic logging fixes

Debug output controlled via debugf() macro instead of commenting
out printf() calls.

Substitute qDebug() with more appropriate qWarning().