Fix some more std::shared_ptr issues.