Also fixes instances where conditionals or other variables may result in hosts executing lists of tasks of differing sizes. Fixes #18748