For completeness, it's worth mentioning there's a decent handling of empty collections in Freemarker since recently.
So the most convenient way to iterate a map is:
<#list tags>
<ul class="posts">
<#items as tagName, tagCount>
<li>{$tagName} (${tagCount})</li>
</#items>
</ul>
<#else>
<p>No tags found.</p>
</#list>
No more <#if ...>
wrappers.