Changed to string comparison type check
Changed RemoveReference() to private.