Fix for ReduceOperator mutable object return bug.
Added unit test for ReduceFunction