fix for list of length 0
Merge pull request #43 from jeroenooms/listfix

fix for list of length 0