computeDiffVector bug fix