Fix validate to use modified copy of cfg.