Does this work for dataset arguments?  May need to check isResultScalar() and behave differently.