Conditional 'isset' Suddenly No Longer Working

This is a weird one. One of those where some code which has been working perfectly in one site, refuses to work in another.

I’ve just duplicated a theme from one Hugo site to use as a starting point for another. There is some conditional template code to show tags [if they exist] as keywords in the header and as a clickable list at the bottom of each post. Heres what I have:

In frontmatter of post:

tags = ["oil", "pressure sensor", "leak", "switch"]

In /themes/mytheme/layouts/partials/header.html:

<meta name="keywords" content="{{ if isset .Params "tags" }}{{ range .Params.tags }}{{ . }}, {{ end }}{{end}}">

Works perfectly. Rendered HTML includes the tags:

<meta name="keywords" content="oil, pressure sensor, leak, switch, ">

Then, in /themes/mytheme/layouts/_default/single.html I have the following:

{{if isset .Params "tags" }}
    			<span class="footermetaheading">Meta</span>
    			TAGS:&#8196;{{ range .Params.tags }}<a class="tag" href="/tags/{{lower . }}">{{lower . }}</a>,&nbsp; {{ end }}<br/>
    			ORIGINAL PUBLICATION DATE:&#8196;{{.Date.Format "02 Jan 2006"}}<br/>
    			AUTHOR:&#8196;{{ .Site.Params.mdrauthor }}
    			{{ end }}
    			{{"<!--  end if it's a blog page show META //-->" | safeHTML}}
    			{{ end }}```

And nothing at all gets output. As I say, it's made all the more mysterious because the code is directly lifted from another of my site's themes, where it works perfectly.

Anything I might have missed here?

PS: In other [possibly] related news; in the aforementioned other site, some  other conditional code has suddenly stopped working as well:

I have set a ```mdrposticon``` variable in the frontmatter for my posts, where I select from a folder full of icon images for that post. If I don't specify a post icon, the template is supposed to fall back on the default icon. Here is the code:

Frontmatter: ```mdrposticon = ""``` [can be set or left blank]

And then in */themes/mytheme/layouts/_default/list.html* and */themes/mytheme/layouts/index.html* I have the following:

```<div class="posticon">
					{{ if isset .Params "mdrposticon" }}
					<img src="{{.Params.mdrposticon }}" />
					{{"<!--  Posticon. Otherwise show default //-->" | safeHTML}}
					{{ else }}
					<img src="/icons/default.png" />
					{{ end }}
				</div>```

Which was working last time I built the site. But now will not output anything, if I've not defined ````mdrposticon```` in the frontmatter.

I've not updated Hugo since last I built the site, so this is a complete mystery. But it seems strangely coincidental that two pieces of code relying on ``{{ isset }`` have started acting up. Can anyone think of anything else, however seemingly unrelated,  that might be borking this? 

Hugo doesn't throw up any errors, on building the sites.

Well, would you believe it!

After tearing my hair out for two days over this and then posting a long-winded plea for help on here, I’ve just spotted the problem [Ain’t it always the way!]

Looking at the whole block of conditional code I pasted in above for adding tags to the bottom of individual posts [instead of just the bit that writes the tags] I spotted the following:

    			{{ if eq .Params.mdrpagetype "blogpage" }}
    			{{"<!--  if it's a blog page show META //-->" | safeHTML}}
    			{{if isset .Params "tags" }}
    			<span class="footermetaheading">Meta</span>
    			TAGS:&#8196;{{ range .Params.tags }}<a class="tag" href="/tags/{{lower . }}">{{lower . }}</a>,&nbsp; {{ end }}<br/>
    			ORIGINAL PUBLICATION DATE:&#8196;{{.Date.Format "02 Jan 2006"}}<br/>
    			AUTHOR:&#8196;{{ .Site.Params.mdrauthor }}
    			{{ end }}
    			{{"<!--  end if it's a blog page show META //-->" | safeHTML}}
    			{{ end }}
    		</footer>```

Note the ```{{ if eq .Params.mdrpagetype "blogpage" }}``` line.

So, what had happened was that when I started importing my new site into Hugo and referring to my existing one as a template, I had looked at my existing site and saw that each post was defined as such by having in the frontmatter: ```mdrpagetype="blogpage"```.

In the nanosecond it took me to switch project windows from old site to new site, this had become scrambled in my brain to ```mdrpagetype="blogpost"``` which I had duly added into the frontmatter for all the posts in the new site.  Result: although Hugo was reading the tags fine all the time, the entire block they were nested in was being ignored because the page types had been set wrong.

So a classic case of the error lying between chair and keyboard!

Now, while I'm on a roll, should I try and suss out the missing post icons, or just go and lie down in a dark corner for a bit?