   // Disable wdt.
   wdt_disable();
 
+  tx = false;
+  fail = false;
+
   // What happened?
-  radio.whatHappened(tx, fail, rx);
+  radio.whatHappened(tx, fail, rx_ack);
 
   if(tx || fail)
     radio.powerDown();
 }
 
-
 void goToSleep(uint8_t timeout) {
-  if(timeout != 0xFF) {
-    // Enable register changes
-    WDTCSR |= (1<<WDCE) | (1<<WDE);
-    // Enable Interrupt mode, 1s timeout
-    WDTCSR = (1<<WDIE) | timeout; 
-  }
-
-  // Go to sleep
+  wdt_enable(timeout);
+  wdt_reset();
+  WDTCSR |= _BV(WDIE);
+  
   sleep_mode();
+  wdt_disable();
+  WDTCSR &= ~_BV(WDIE);
 }
 
-ISR(WDT_vect) {
-  cli();
-
-  // Disable wdt.
+SIGNAL(WDT_vect) {
   wdt_disable();
-  
-  sei();
+  wdt_reset();
+  WDTCSR &= ~_BV(WDIE);
 }
  power_timer1_disable();
  power_timer2_disable();
  power_twi_disable();
  //power_usart0_disable();
  
  // Set sleep tothe most power-saving mode.
  set_sleep_mode(SLEEP_MODE_PWR_DOWN);


RF24 radio(RF24_CE, RF24_CSN);

bool timeout, rx_ack, tx, fail;

void setup(void) {
  // Serial.begin(9600);
