Some updates to scheduler.c