Remove some more unnecessary use of shared_ptr.