Fix bug so that when a CheckBox, Switch, or ToggleButton is clicked, its state is toggled.
Remove superfluous newlines.