Implement min and max uid.