Added support for custom MessageHandlers.