Use numpy.intp_t for indices