Better fix for the min() issue.