Added include <algorithm> in ifdef WIN32 and VS2013

Added type in std::min/std::max