Fix painful bug in eventlogging code

Change-Id: I3026aadcb28e7a8325137214512163558cccf2db
Merge "Fix painful bug in eventlogging code"