Fix warnings due to converting from size_t to ints