Fix misuses of std::numeric_limits<T>::min.

Fix misuses of std::numeric_limits<T>::min.