Fix many small bugs in net stuff.