Bugfixes to the best hit determination methods