network: Remove unused include
network: Correctly check for error conditions