Fixes checkboxes not being (un)checked in invert selection.