#include <algorithm> for std::max, std::min on VS2013.
Merge pull request #4187 from dumganhar/develop

#include <algorithm> for std::max, std::min on VS2013.