Various fixes to the network routing code.