Fix generation of event ids so that they are consistent between local and remote ids