Fix NameError in events models.