cdist fix.