Fixed the events system.