some ref-counting errors fixed
get rid of a warning