Bugfix: correctly access name in Function constructor
Add test of Function.name and friends