Moving final closed `</li>` and `</ul>` out of output loop.