Only include the global handlers in the return statement that actually seem to be defined.