Fix gcc -Wconversion warnings
R vectors (incl. NumericVector) are indexed with int, not size_t.