Changed variable refs min and max to Min and Max.