Fix ego network encoding