update tests and fix NewCfg()