Fix bug in NetworkUtils