Fix NPE for empty lists in functions.
Merge pull request #17 from JacekLach/npe-on-empty-list

java.lang.UnsupportedOperationException: Unknown Collection type