Tweak how events are registered.

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>