Adapt sleep() and friends to new spec