fixing up the various misappropriations of shared ptrs from the first pass and whatnot