Clear up some std::size_t/int confusion and get rid of warnings.