heap: proper check for function objects
visitor: visit functions properly