Fixing null provider defects.

Change-Id: I3a4df1d5821e1961e1c70270a6be3642d0c3a60e
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/NullProviders.java b/providers/null/src/main/java/org/onosproject/provider/nil/NullProviders.java
index f6236c4..08be68a 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/NullProviders.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/NullProviders.java
@@ -329,10 +329,10 @@
                        new DefaultServiceDirectory(),
                        deviceProviderService, hostProviderService,
                        linkProviderService);
-        simulator.setUpTopology();
         flowRuleProvider.start(flowRuleProviderService);
         packetProvider.start(packetRate, hostService, deviceService,
                              packetProviderService);
+        simulator.setUpTopology();
         topologyMutationDriver.start(mutationRate, linkService, deviceService,
                                      linkProviderService, deviceProviderService,
                                      simulator);
diff --git a/providers/null/src/main/java/org/onosproject/provider/nil/TopologySimulator.java b/providers/null/src/main/java/org/onosproject/provider/nil/TopologySimulator.java
index 745fd51..b89f94a 100644
--- a/providers/null/src/main/java/org/onosproject/provider/nil/TopologySimulator.java
+++ b/providers/null/src/main/java/org/onosproject/provider/nil/TopologySimulator.java
@@ -230,7 +230,7 @@
      */
     protected void createHosts(DeviceId deviceId, int portOffset) {
         String s = deviceId.toString();
-        byte dByte = Byte.parseByte(s.substring(s.length() - 1), 16);
+        byte dByte = Byte.parseByte(s.substring(s.length() - 2), 16);
         // TODO: this limits the simulation to 256 devices & 256 hosts/device.
         byte[] macBytes = new byte[]{0, 0, 0, 0, dByte, 0};
         byte[] ipBytes = new byte[]{(byte) 192, (byte) 168, dByte, 0};