Fix up logging; handle template dir problem