Small changes to scheduler