Fix QT5DIR key error in hookutils. Fix printing to stdout when running tests.