Perpatch compare: avg_diff is not an int