Fixed missgenerated reference counts for events