Added support for complex functions