Improved checkbox handling