fix bugs around configuration file generation.