Fixing compile issue with the DeepCopy function where the 'typename' keyword was missing
Removing unused variables.
Fixing reorder compile warnings.