Bugfix for switch detection.