Corrected call to lists:foldl.