Replaced std::any_of/boost::algorithm::any_of with std::min

Along with removing implicit boost::shared_ptr conversions.