Added processing of controller hooks when serving error pages.