Fixes to event scheduler