Properly clean up dependent and read tasks.