Corrected multiple bugs in checkbox selection.