Fixed an error that prevented a min value to be calculated when finding duplicated items