Various networking fixes