Flatten tasks.