Fix registering events before onEnable