Fix StackOverflowException on getNetwork.