Add #include for std::max()
Add #include for std::min() (different file)
Merge master into osx