Improve handling of default middleware and context processors.