Fixed the event handling on both XbeeShield and iotest-board