Enable logging of undefined template keys only when debug mode is on.
Merge branch 'tng' into rework-sorting