Fixed compile errors for "error C2039: 'max' : is not a member of 'std'"...

... with Visual Studio 2013 (and perhaps others) by adding include for algorithm.