Some fixes of log and cfg.