The argument order passed to f is reversed in the reference implementation.

I'm fixing it along the change of making it take multiple vectors.  This is just for heads-up.