Fixes error caused when a method with events was called directly, without __invoke