Fixes function serialization
Merge pull request #19 from johnynek/feature/fn-fix2

Fixes function serialization