Reduced unnecessary copies of shared_ptr when copying String.