Fixed some weirdness with event registration