change the type of some variables from size_t to uint64_t

In my 32bit Ubuntu environment, size_t and uint64_t are NOT the same, therefore some tests fail.
This change would not affect the environment where size_t and uint64_t are the same.