refcount fixes