Fix heuristic function signature