Fix scheduler loop.