! Allow linking of existing events to new topics (fixes #1224)

Also fixes an issue with a missing global variable in the insertEvent() function.

Signed-off-by: Michael Eshom <oldiesmann@oldiesmann.us>