Fixed an infinite loop by setting maxredirects.