Fixed some stuff around scheduler, added more tests
Merge branch 'master' into development