Simulator Crash Caused by GenericChannel.sendAcknowledge

I'm getting a Simulator crash every time when using the setTime() function in the MO2Sensor.mc example code inthe MO2Display example project.

To invoke the setTime() function, I added the following code inside the OnMessage(msg) function of MO2Sensor.

function onMessage(msg)
{
// Parse the payload
var payload = msg.getPayload();

if( Ant.MSG_ID_BROADCAST_DATA == msg.messageId )
{
if( 1 == (payload[0].toNumber() & 0xFF) ) //Need to change from MuscleOxygenDataPage.PAGE_NUMBER to 1 in Sample Code
{
// Were we searching?
if(searching)
{
searching = false;
// Update our device configuration primarily to see the device number of the sensor we paired to
deviceCfg = GenericChannel.getDeviceConfig();
}
var dp = new MuscleOxygenDataPage();
dp.parse(msg.getPayload(), data);
// Check if the data has changed and we need to update the ui
if(pastEventCount != data.eventCount)
{
Ui.requestUpdate();
pastEventCount = data.eventCount;
if(data.utcTimeSet == true) // Added code to call setTime()
{ // Added code to call setTime()
System.println("setting time"); // Added code to call setTime()
setTime(); // Added code to call setTime()
} // Added code to call setTime()
}
}
}


I've isolated it down (using println) to the crash occurring during the GenericChannel.sendAcknowledge(message); line of code.

function setTime()
{
if( !searching
&& ( data.utcTimeSet ) )
{
//Create and populat the data payload
var payload = new [8];
payload[0] = 0x10; //Command data page
payload[1] = 0x00; //Set time command
payload[2] = 0xFF; //Reserved
payload[3] = 0; //Signed 2's complement value indicating local time offset in 15m intervals

//Set the current time
var moment = Time.now();
for(var i = 0; i < 4; i++)
{
payload[i + 4] = ((moment.value() >> i) & 0x000000FF); //This doesn't parse correctly but that's not the problem
}

//Form and send the message
var message = new Ant.Message();
message.setPayload(payload);
GenericChannel.sendAcknowledge(message); //This line is where it crashes
}
}


I've further isolated it down that first 7 of the 8 bytes of data of the command data page are being sent correctly. The 8th byte doesn't seem to be making it. I expected the simulator to send out a [10] [00] [FF] [00] [9B] [74] [B4] [54] but what is received by the SimulANT+ is only [10] [00] [FF] [00] [9B] [74] [B4] [00]