Improved filename generation for config file.