Convert std::shared_ptr's to std::unique_ptr