Small refactoring with a new method.
Fixed a small error when filling checkboxes.

Also changed to doClick in case we need the
events to be launched (e.g. for dependencies).