Made cmdfd not global anymore.