Fix bug in define_reactor_callbacks