Shared_ptr fixes