Fixed alot of small problems with foldl and foldr