Some add Ref stuff

Fixed some add Ref bugs