bug fix for on-the-fly patch similarity