Added a check for redirects for debugging.