Fix average degree computation