Fix scope for function and fix foldl
DRY tests
Include files