Added defensive copy for tests in Task