Improvements to redirection detection.