[coretasks] Fix handling of multiple modes being set at the same time

Issue #175