Fixed the event scheduler.