[CAP-179] Fix the template to check the array length correctly.
Merge pull request #39 from jhelmer-unicon/CAP-179_zero_state_for_events

[CAP-179] Fix the template to check the array length correctly.