Solaris compilers did not know about INT_MAX, so I simply replaced using