Better handling of switch events