fix model_sqdist