convert old style casts to fix warnings
refactor an if block to std::min
fix std:min call, include algorithm and compare same type
Merged branch 'master' of git://github.com/sriehl/MCServer