Fixed shallow copying errors.