Fix types for foldl and foldr with 3 lists.

Thanks to Jack Firth for the report.