Fixes for one of the generic evaluation versions of pairwise!

The existing version did not have both an `a` and a `b` argument. Also, the function modifies its input argument `a`. 

My modifications worked in one test, but I'm not an expert here, so please check.