I think I have the casting for the CountedPtr corrected. I added some more ReferenceCountTraits to more clearly distinguish between between the pointer manager and the target type. This will need to be documented and some renaming might need to occur, and it still has not been tested.