Added support for function with return values, generates only Invoke