Added support for remote functions with return values.