Fix exception handling in network creation