Implemented deep copying for Task classes