Fixed max dist error