Fixed some of the issues with networking

Networking may need a rewrite