Added check against possible redirects.