Fix the time mask / event overlapping bug