Fixed a few crashes in network