Fixed a problem with ref counted.