Fix redirects on error