size_t for compatibility on macosx

Following commit prevents std::min error messages that complaint about lack of required min func. template