Renamed typedef to indicate being a shared_ptr.
Reimplement double registering check.