Small tweaks on the gate mode handling.