Numerous logfile naming bugfixes.