Make mode variable const.