fixed a bug in subNetworkHelper concerning boundary branches