Added debug logging
Fixed a foldl