Fixed bad logic in config file writer