Fixed compilation on VC12 (VS2013 RC)

std::min and std::max require the algorithm header, omitting this breaks the build on Visual Studio 2013 RC.