KB - refcount bug fixes