Avoid null pointer and fix missing line instantiating mnetworksimulation