I'm trying to collect some climate and security "snapshots" every 30 minutes and having trouble with this code. It used to work with the previous version and I think I got all the proper corrections for the new version syntax. Where is my stupid mistake(s)? 

Code:
//Run on forced or automatic refresh (4AM)
function onRefreshConfig(forced) {
controller.refreshAuxiliarySensors();
controller.refreshZones();
controller.refreshMessages();
}
//Climate Stat Collection
var isCollectingStats = false;
function onSyncStart(forced, timestamp) {
if(!isCollectingStats) collectStats();
}
function collectStats() {
if(controller.isConnected) { // Make sure we don't log nonsense if we aren't connected
isCollectingStats = true;
var line = controller.date + ',';
//Get Outdoor Temp
line += parseInt(controller.outdoorTemperatureSensor.valueDescription) + ',';
//Get Outdoor Humidity
line += parseInt(controller.outdoorHumiditySensor.valueDescription) + ',';
//Get Indoor Temp
line += parseInt(controller.auxiliarySensorWithNumber(1).valueDescription) + ',';
//Get Indoor Humidity
line += parseInt(controller.auxiliarySensorWithNumber(2).valueDescription) + ',';
//Get Status of Windows Zones 5 - 15 (Windows 1 - 12 - no number 2 window)
//Status reports 0 if closed and 1 if open
line += controller.zoneWithNumber(5).status + ',';
line += controller.zoneWithNumber(6).status + ',';
line += controller.zoneWithNumber(7).status + ',';
line += controller.zoneWithNumber(8).status + ',';
line += controller.zoneWithNumber(9).status + ',';
line += controller.zoneWithNumber(10).status + ',';
line += controller.zoneWithNumber(11).status + ',';
line += controller.zoneWithNumber(12).status + ',';
line += controller.zoneWithNumber(13).status + ',';
line += controller.zoneWithNumber(14).status + ',';
line += controller.zoneWithNumber(15).status + ',';
//Get Status Skylights Zones 16 South 1,49 South 2,50 North 3,51 North 4
line += controller.zoneWithNumber(16).status + ',';
line += controller.zoneWithNumber(49).status + ',';
line += controller.zoneWithNumber(50).status + ',';
line += controller.zoneWithNumber(51).status + ',';
//Get Status of Fans Unit 263(West Fan) and 264 (East Fan)
line += controller.unitWithNumber(263).state + ',';
line += controller.unitWithNumber(264).state + ',';
// The file gets stored in ~/Library/Application Support/com.nullriver.HaikuHelper2/
//Could change this to an absolute path in webserver
helper.logToExternalFile('../../../ClimateStats.csv', line); //Logs to user home dir
setTimeout('collectStats()', 30*60*1000); // Every 30 minutes
} else {
isCollectingStats = false;
}
}