Networking fixes and tweaks

More secure and less glitchy