A couple of tweaks to how file names are generated

A simplification and a small feature improvement, nothing big