Add virtual destructor
Manually cast types passed to std::max

In CMSSW 6 gcc the arguments to std::max can't
be coerced to the same type.  Generates really gnarly
compiler errors.