Added support for functions.