Added support for functions and process function cache.