Fixed scheduler bug
Added more scheduler test cases and fixed small scheduler bug