Distance: fix bug in Hamming distance that skipped the head pair #220