Use foldl1 for non-empty lists only
Merge pull request #10 from dmalikov/master

Thanks, sorry for mistake