Added dependency resolution when removing tasks.