Fixed some minor bugs, written tests on Scheduler (relates to #35)