Fixed a lot of network bugs.