Shared pointer fix