Fixed a bug when calculating the distance from root of an object.
Added a copy constructor to Pointer.