use standard INT64_MAX instead of MAXINT64 (and MIN)