Fixed first click prevention when triggerOnClick is used or touch events. Some refactoring.