Fixes the return of foldr for []