Fixed minor bugs with the optgroup checkboxs

Fixed minor bug where uncheck all was not clearing the optgroup checkbox and another with tracking the selected attribute on the optgroup.