fix refcnt handling.