Added unit tests for folds and fixed foldr