Restructure output filename construction a little.