Fix bug caused by non-empty TEMPLATE_STRING_IF_INVALID in settings (fixes #81)