Fix bug and typo: head_tails is heads_tails.

Andrea