Issue #193: Improvements in the scheduling algorithm.