Fix 2 bugs in SharedPtr<>