How about the following for the WAKE_UP_NOTIFICATION:
```
logger.trace("Process Wake Up Notification");
				
logger.debug("Node {} is awake", this.getNode().getNodeId());
serialMessage.setTransActionCanceled(true);

// if this node has not gone through it's query stages yet, and there
// are no initialization packets on the wake-up queue, restart initialization.
if (!this.initializationComplete && (this.wakeUpQueue.isEmpty() || this.getNode().getNodeStage() == NodeStage.DEAD)) {
	logger.info("Got Wake Up Notification from node {}, continuing initialization.", this.getNode().getNodeId());
					
	this.getNode().setNodeStage(NodeStage.WAKEUP);
	this.getNode().advanceNodeStage(NodeStage.DETAILS);
}

// Set the awake flag. This will also empty the queue
this.setAwake(true);
```

This is slightly less efficient in that the node stage messages will be queued since 'awake' is not true when they are called but since this is only for initialisation I don't think that's an issue. I removed the 'return' so it drops through and then empties the queue.

I also did a search and setAwake(true) is only called here (and also now in the controller where I added it) so I think this is safe.

Since the sendPending call is now only called from setAwake, I'll merge the two rather than calling sendPending from setAwake.

This works fine for my battery devices. If you like I can make a PR for testing...