Added support for functions and closures.