change std::min to MIN() macro. additional fixes to compile with VS2008
again.
more