Fix handling of context in cached calls to on()