Fix logging and templating.