Fix switch-click bug and enable gate selection