Fixing bugs from string.Template switch