Fix operator shared_ptr<T> for the Value class

fixes #7586