Fix scheduler
Minor tidy up