Fixed min distance check.