Fix initialization of optimization_distance.