Fix reference count leak