Clean up options to modules middleware.