         if (value == 42) Serial.println("Backed Up");
 
         if (value == 123) {
-          for (byte i = 0; i < RF12_EEPROM_SIZE; ++i) {     // Check CRC to be restored
-	        crc = _crc16_update(crc, eeprom_read_byte(RF12_EEPROM_ADDR + RF12_EEPROM_SIZE + i)); 
-          }
-          if (crc) { 
+          const uint8_t *ee_shadow = RF12_EEPROM_ADDR + RF12_EEPROM_SIZE;
+          // Check CRC to be restored
+          word crc = ~0;
+          for (byte i = 0; i < RF12_EEPROM_SIZE; ++i)
+            crc = _crc16_update(crc, eeprom_read_byte(ee_shadow + i)); 
+          if (crc)
             Serial.println("Bad CRC"); 
-          } else {
-              for (byte i = 0; i < RF12_EEPROM_SIZE; ++i) {
-                byte b = eeprom_read_byte((RF12_EEPROM_ADDR + RF12_EEPROM_SIZE) + i);
-                showNibble(b >> 4);
-                showNibble(b);
-                eeprom_write_byte((RF12_EEPROM_ADDR) + i, b);
-              }
+          else {
+            for (byte i = 0; i < RF12_EEPROM_SIZE; ++i) {
+              byte b = eeprom_read_byte((ee_shadow) + i);
+              showNibble(b >> 4);
+              showNibble(b);
+              eeprom_write_byte((RF12_EEPROM_ADDR) + i, b);
+            }
             Serial.println();
             Serial.println("Restored");
             }
-          if (rf12_config()) initialize(); else Serial.println("Initialize failed");
-          }
-        break;
-#if defined debug
+          if (rf12_config())
+            initialize();
+          else
+            Serial.println("Initialize failed");
+        }
+        break;
+#if DEBUG
       case 'n': // Clear eeprom
         if (value == 123) {
-          for (byte i = 0; i < (RF12_EEPROM_SIZE); ++i) {  // Use to clear config eeprom then backup to clear backup eeprom
-            byte b = 255;
-            eeprom_write_byte(RF12_EEPROM_ADDR + i, b);
-          }
+          // Use to clear config eeprom then backup to clear backup eeprom
+          for (byte i = 0; i < (RF12_EEPROM_SIZE); ++i)
+            eeprom_write_byte(RF12_EEPROM_ADDR + i, 0xFF);
           Serial.println("Cleared");
         }
         break;
-/////////////////////
-      } // End Switch
+    } // End Switch
 #endif      
     value = top = 0;
     memset(stack, 0, sizeof stack);

#include <avr/pgmspace.h>
#include <util/parity.h>

#define debug
// ATtiny's only support outbound serial @ 38400 baud, and no DataFlash logging

#if defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny44__)
#define SERIAL_BAUD 38400
#define JNMicro
#else
#define SERIAL_BAUD 57600

#define DATAFLASH 0          // Enabling flash for none flash equipped nodes causes odd problems - particularly non-Jee kit
// check for presence of DataFlash memory on JeeLink
#define FLASH_MBIT  16  // support for various dataflash sizes: 4/8/16 Mbit


  Serial.begin(SERIAL_BAUD);
  displayVersion(0);
  activityLed(0);

  if (rf12_config())
    initialize();
  else {
    config.nodeId = 0x41; // 433 MHz, node 1
    config.group = 0xD4;  // default group 212
    frequency = 1600;
    config.flags = 0xC;   // Default flags, quiet off and non V10
//  saveConfig();         // Don't save to eeprom until we have changes.
  }

#if DATAFLASH
