Fixed pairwise potential bug