Fixes to optimal preference selection in heuristic. Still not completely correct.