Fix generation of events randomly