Better fix for refcnting tests