Fix bug in event persistence logic which caused 'NoneType is not iterable'