Fixed AddRef() and Release() logic