Networking script fixes v2

Fixed issues found in previous review.