Fix sorting in networks