Improved network code a bit.