Added tests and fixed scheduling-algorithm/spb.