[events] Fix test and some bugs