Tweaks to networking code