RF: changed the type of iteration variables and array sizes from int to npy_intp