Fix curl redirect bug.