Improved Page404 and Page500 handlers