Minor fixes to get automation (alarm) mode working.