Fix relay control