Change type of N param from uint64_t to size_t