Minor fix to xreate events with actual event code.