bugfix in network utilities + unit tests.