Added support for return_type option.