Fixed a delay scheduling bug in the YARN branch, found by Patrick