Fix behavior separately for checkboxes and radio buttons