Improvement of the shared pointer implementation.