ODE-942: fixing a scheduler bug. Thanks Waruna for the patch.