Updated unit test for sched module and fixed one bug on the sched module