Fix a bad residue bug in best-head.