Fixes to scheduling