#117487, make sure root node gets created properly, and prevent changing priority when there are no adjacent tasks.